Exemplo n.º 1
0
 def returns_unique_Collection_objects_for_same_input_module(self):
     # Ignoring self.c for now, just in case it changes later.
     # First, a module with no root NS
     mod = load('integration')
     c1 = Collection.from_module(mod)
     c2 = Collection.from_module(mod)
     assert c1 is not c2
     # Now one *with* a root NS (which was previously buggy)
     mod2 = load('explicit_root')
     c3 = Collection.from_module(mod2)
     c4 = Collection.from_module(mod2)
     assert c3 is not c4
Exemplo n.º 2
0
 def returns_unique_Collection_objects_for_same_input_module(self):
     # Ignoring self.c for now, just in case it changes later.
     # First, a module with no root NS
     mod = load('integration')
     c1 = Collection.from_module(mod)
     c2 = Collection.from_module(mod)
     assert c1 is not c2
     # Now one *with* a root NS (which was previously buggy)
     mod2 = load('explicit_root')
     c3 = Collection.from_module(mod2)
     c4 = Collection.from_module(mod2)
     assert c3 is not c4
Exemplo n.º 3
0
 def honors_subcollection_default_tasks_on_subcollection_name(self):
     sub = Collection.from_module(load('decorator'))
     self.c.add_collection(sub)
     # Sanity
     assert self.c['decorator.biz'] is sub['biz']
     # Real test
     assert self.c['decorator'] is self.c['decorator.biz']
Exemplo n.º 4
0
 def setup(self):
     mod = load('explicit_root')
     mod.ns.configure({'key': 'builtin', 'otherkey': 'yup'})
     mod.ns.name = 'builtin_name'
     self.unchanged = Collection.from_module(mod)
     self.changed = Collection.from_module(
         mod, name='override_name', config={'key': 'override'})
Exemplo n.º 5
0
 def setup(self):
     mod = load('explicit_root')
     mod.ns.configure({'key': 'builtin', 'otherkey': 'yup'})
     mod.ns.name = 'builtin_name'
     self.unchanged = Collection.from_module(mod)
     self.changed = Collection.from_module(
         mod,
         name='override_name',
         config={'key': 'override'}
     )
Exemplo n.º 6
0
 def honors_explicit_collections(self):
     coll = Collection.from_module(load('explicit_root'))
     assert 'top_level' in coll.tasks
     assert 'sub' in coll.collections
     # The real key test
     assert 'sub_task' not in coll.tasks
Exemplo n.º 7
0
 def setup(self):
     self.c = Collection.from_module(load('integration'))
Exemplo n.º 8
0
 def setup(self):
     self.c = Collection.from_module(load('explicit_root'))
Exemplo n.º 9
0
 def honors_subcollection_task_aliases(self):
     self.c.add_collection(load('decorator'))
     assert 'decorator.bar' in self.c
Exemplo n.º 10
0
 def can_take_module_objects(self):
     self.c.add_collection(load('integration'))
     assert 'integration' in self.c.collections
Exemplo n.º 11
0
 def allows_tasks_with_explicit_names_to_override_bound_name(self):
     coll = Collection.from_module(load('subcollection_task_name'))
     assert 'explicit_name' in coll.tasks  # not 'implicit_name'
Exemplo n.º 12
0
 def setup(self):
     self.mod = load('integration')
     self.fm = Collection.from_module
Exemplo n.º 13
0
 def setup(self):
     self.mod = load('integration')
     self.fm = Collection.from_module
Exemplo n.º 14
0
 def allows_tasks_with_explicit_names_to_override_bound_name(self):
     coll = Collection.from_module(load('subcollection_task_name'))
     assert 'explicit_name' in coll.tasks # not 'implicit_name'