~divmod-dev/divmod.org/multiple-to-1940

« back to all changes in this revision

Viewing changes to Axiom/axiom/test/historic/stub_parentHook3to4.py

  • Committer: exarkun
  • Date: 2009-07-07 20:35:43 UTC
  • Revision ID: svn-v4:866e43f7-fbfc-0310-8f2a-ec88d1da2979:trunk:17723
Merge scheduler-nonitem-1408-2

Author: exarkun
Reviewer: glyph
Fixes: #1408

Introduce an in-memory-only `IScheduler` adapter for `Store` which supercedes
the `Scheduler` and `SubScheduler` item classes.  `Scheduler` and `SubScheduler`
still exist, but they will be deprecated shortly, and then upgraded out of
existence.  The correct way to get the scheduler for a store is to adapt the
store to `IScheduler`.  This will succeed without any particular database
state being created to support it.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- test-case-name: axiom.test.historic.test_parentHook3to4 -*-
 
2
 
 
3
"""
 
4
Generate a test stub for upgrading L{_SubSchedulerParentHook} from version 3 to
 
5
4, which removes the C{scheduler} attribute.
 
6
"""
 
7
 
 
8
from axiom.test.historic.stubloader import saveStub
 
9
 
 
10
from axiom.dependency import installOn
 
11
from axiom.scheduler import Scheduler, _SubSchedulerParentHook
 
12
from axiom.substore import SubStore
 
13
 
 
14
def createDatabase(store):
 
15
    scheduler = Scheduler(store=store)
 
16
    installOn(scheduler, store)
 
17
    installOn(
 
18
        _SubSchedulerParentHook(
 
19
            store=store, loginAccount=SubStore(store=store)),
 
20
        store)
 
21
 
 
22
 
 
23
if __name__ == '__main__':
 
24
    saveStub(createDatabase, 17606)