def NewScope(): expect(len(ioc._MyScopes())).toBe(2) ioc.Injectable.value(bar='baz') t = T() t.start() t.join() return t.name
def it_should_support_the_main_thread_adding_scopes_for_children(self): class T(ioc.threading.Thread): @ioc.Inject def run(self, bar=ioc.IN): self.setName(bar) expect(len(ioc._MyScopes())).toBe(2) @ioc.Scope def NewScope(): expect(len(ioc._MyScopes())).toBe(2) ioc.Injectable.value(bar='baz') t = T() t.start() t.join() return t.name expect(len(ioc._MyScopes())).toBe(1) expect(NewScope()).toEqual('baz')
def run(self, bar=ioc.IN): self.setName(bar) expect(len(ioc._MyScopes())).toBe(2)