コード例 #1
0
ファイル: ioc_test.py プロジェクト: yozo1984/dpy
 def NewScope():
   expect(len(ioc._MyScopes())).toBe(2)
   ioc.Injectable.value(bar='baz')
   t = T()
   t.start()
   t.join()
   return t.name
コード例 #2
0
 def NewScope():
   expect(len(ioc._MyScopes())).toBe(2)
   ioc.Injectable.value(bar='baz')
   t = T()
   t.start()
   t.join()
   return t.name
コード例 #3
0
ファイル: ioc_test.py プロジェクト: yozo1984/dpy
  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')
コード例 #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')
コード例 #5
0
ファイル: ioc_test.py プロジェクト: yozo1984/dpy
 def run(self, bar=ioc.IN):
   self.setName(bar)
   expect(len(ioc._MyScopes())).toBe(2)
コード例 #6
0
 def run(self, bar=ioc.IN):
   self.setName(bar)
   expect(len(ioc._MyScopes())).toBe(2)