def testBindScope(self): class Scope(object): pass scope = Scope() injector = Injector() injector.bind_scope(Scope, scope) self.assertTrue(injector.get(Scope) is scope) self.assertTrue(injector.is_scope_bound(Scope))
def testUnbindScope(self): class Scope(object): pass scope = Scope() injector = Injector() injector.bind_scope(Scope, scope) injector.unbind_scope(Scope) self.assertFalse(injector.is_bound(Scope)) self.assertFalse(injector.is_scope_bound(Scope))