示例#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)