Ejemplo n.º 1
0
 def NewScope():
   expect(len(ioc._MyScopes())).toBe(2)
   ioc.Injectable.value(bar='baz')
   t = T()
   t.start()
   t.join()
   return t.name
Ejemplo n.º 2
0
 def NewScope():
   expect(len(ioc._MyScopes())).toBe(2)
   ioc.Injectable.value(bar='baz')
   t = T()
   t.start()
   t.join()
   return t.name
Ejemplo n.º 3
0
  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')
Ejemplo n.º 4
0
  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')
Ejemplo n.º 5
0
 def run(self, bar=ioc.IN):
   self.setName(bar)
   expect(len(ioc._MyScopes())).toBe(2)
Ejemplo n.º 6
0
 def run(self, bar=ioc.IN):
   self.setName(bar)
   expect(len(ioc._MyScopes())).toBe(2)