示例#1
0
  def it_should_detect_name_conflict_in_same_scope(self):

    def InjectValue():
      ioc.Injectable.value(val=42)

    InjectValue()
    expect(InjectValue).toRaise(ValueError)
示例#2
0
  def it_should_allow_calling_injectables_for_testability(self):

    @ioc.Injectable
    def foo(val=ioc.IN):
      return val

    expect(foo(val=99)).toBe(99)
示例#3
0
    def it_should_track_recursive_dep_and_attach_to_the_deepest(self):
      @ioc.Injectable
      def parent_val(leaf_val=ioc.IN):
        return leaf_val

      @ioc.Inject
      def GetSingleton(parent_singleton=ioc.IN):
        return parent_singleton

      @ioc.Scope
      def ParentScope():

        @ioc.Scope
        def LeafScope():
          ioc.Injectable.value(leaf_val=object())
          expect(GetSingleton()).toBe(GetSingleton())
          return GetSingleton()

        expect(LeafScope()).notToBeNone()
        # parent_singleton should attach to leaf because parent_val depends on
        # leaf_val
        expect(GetSingleton).toRaise(ValueError)

      ParentScope()
      expect(GetSingleton).toRaise(ValueError)
示例#4
0
 def NewScope():
   expect(len(ioc._MyScopes())).toBe(2)
   ioc.Injectable.value(bar='baz')
   t = T()
   t.start()
   t.join()
   return t.name
示例#5
0
文件: ioc_test.py 项目: yozo1984/dpy
    def it_should_track_recursive_dep_and_attach_to_the_deepest(self):
      @ioc.Injectable
      def parent_val(leaf_val=ioc.IN):
        return leaf_val

      @ioc.Inject
      def GetSingleton(parent_singleton=ioc.IN):
        return parent_singleton

      @ioc.Scope
      def ParentScope():

        @ioc.Scope
        def LeafScope():
          ioc.Injectable.value(leaf_val=object())
          expect(GetSingleton()).toBe(GetSingleton())
          return GetSingleton()

        expect(LeafScope()).notToBeNone()
        # parent_singleton should attach to leaf because parent_val depends on
        # leaf_val
        expect(GetSingleton).toRaise(ValueError)

      ParentScope()
      expect(GetSingleton).toRaise(ValueError)
示例#6
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
示例#7
0
文件: ioc_test.py 项目: yozo1984/dpy
  def it_should_detect_name_conflict_in_same_scope(self):

    def InjectValue():
      ioc.Injectable.value(val=42)

    InjectValue()
    expect(InjectValue).toRaise(ValueError)
示例#8
0
文件: ioc_test.py 项目: yozo1984/dpy
  def it_should_allow_calling_injectables_for_testability(self):

    @ioc.Injectable
    def foo(val=ioc.IN):
      return val

    expect(foo(val=99)).toBe(99)
示例#9
0
文件: ioc_test.py 项目: yozo1984/dpy
  def it_should_not_mangle_classes(self):

    @ioc.Inject
    class Bar(object):
      def __init__(self):
        super(Bar, self).__init__()

    expect(Bar).notToRaise(TypeError)
示例#10
0
  def it_should_not_mangle_classes(self):

    @ioc.Inject
    class Bar(object):
      def __init__(self):
        super(Bar, self).__init__()

    expect(Bar).notToRaise(TypeError)
示例#11
0
      def ParentScope():
        ioc.Injectable.value(parent_val=object())

        @ioc.Scope
        def LeafScope():
          # Get parent_singleton for the first time inside leaf scope.
          return GetSingleton()
        # The singleton should stay the same even leaf scope is popped.
        expect(LeafScope()).toBe(GetSingleton())
示例#12
0
文件: ioc_test.py 项目: yozo1984/dpy
      def ParentScope():
        ioc.Injectable.value(parent_val=object())

        @ioc.Scope
        def LeafScope():
          # Get parent_singleton for the first time inside leaf scope.
          return GetSingleton()
        # The singleton should stay the same even leaf scope is popped.
        expect(LeafScope()).toBe(GetSingleton())
示例#13
0
文件: ioc_test.py 项目: yozo1984/dpy
  def it_should_allow_calling_injectables(self):

    @ioc.Injectable
    def foo(bar=ioc.IN):
      return 'foo %s' % bar

    ioc.Injectable.value(bar='bar')

    expect(foo()).toEqual('foo bar')
    expect(foo(bar='candybar')).toEqual('foo candybar')
示例#14
0
文件: ioc_test.py 项目: yozo1984/dpy
      def ParentScope():

        @ioc.Scope
        def LeafScope():
          ioc.Injectable.value(leaf_val=object())
          return GetSingleton()

        expect(LeafScope()).notToBeNone()
        # leaf_singleton should have been popped.
        expect(GetSingleton).toRaise(ValueError)
示例#15
0
      def ParentScope():

        @ioc.Scope
        def LeafScope():
          ioc.Injectable.value(leaf_val=object())
          return GetSingleton()

        expect(LeafScope()).notToBeNone()
        # leaf_singleton should have been popped.
        expect(GetSingleton).toRaise(ValueError)
示例#16
0
  def it_should_allow_calling_injectables(self):

    @ioc.Injectable
    def foo(bar=ioc.IN):
      return 'foo %s' % bar

    ioc.Injectable.value(bar='bar')

    expect(foo()).toEqual('foo bar')
    expect(foo(bar='candybar')).toEqual('foo candybar')
示例#17
0
  def it_should_inject(self):

    @ioc.Injectable
    def foo():  # pylint: disable=unused-variable
      return 42

    @ioc.Inject
    def bar(foo=ioc.IN):
      return foo

    expect(bar()).toBe(42)
示例#18
0
文件: ioc_test.py 项目: yozo1984/dpy
  def it_should_inject(self):

    @ioc.Injectable
    def foo():  # pylint: disable=unused-variable
      return 42

    @ioc.Inject
    def bar(foo=ioc.IN):
      return foo

    expect(bar()).toBe(42)
示例#19
0
文件: ioc_test.py 项目: yozo1984/dpy
  def it_should_support_naming_injectables(self):

    @ioc.Injectable.named('bar')
    def foo():  # pylint: disable=unused-variable
      return 42

    @ioc.Inject
    def bar(bar=ioc.IN):
      return bar

    expect(bar()).toBe(42)
示例#20
0
文件: ioc_test.py 项目: yozo1984/dpy
  def it_should_allow_overwriting_injectables(self):

    @ioc.Injectable
    def foo():  # pylint: disable=unused-variable
      return 42

    @ioc.Inject
    def bar(foo=ioc.IN):
      return foo

    expect(bar(foo=99)).toBe(99)
示例#21
0
  def it_should_allow_overwriting_injectables(self):

    @ioc.Injectable
    def foo():  # pylint: disable=unused-variable
      return 42

    @ioc.Inject
    def bar(foo=ioc.IN):
      return foo

    expect(bar(foo=99)).toBe(99)
示例#22
0
  def it_should_support_naming_injectables(self):

    @ioc.Injectable.named('bar')
    def foo():  # pylint: disable=unused-variable
      return 42

    @ioc.Inject
    def bar(bar=ioc.IN):
      return bar

    expect(bar()).toBe(42)
示例#23
0
      def ParentScope():

        @ioc.Scope
        def LeafScope():
          ioc.Injectable.value(leaf_val=object())
          expect(GetSingleton()).toBe(GetSingleton())
          return GetSingleton()

        expect(LeafScope()).notToBeNone()
        # parent_singleton should attach to leaf because parent_val depends on
        # leaf_val
        expect(GetSingleton).toRaise(ValueError)
示例#24
0
文件: ioc_test.py 项目: yozo1984/dpy
      def ParentScope():

        @ioc.Scope
        def LeafScope():
          ioc.Injectable.value(leaf_val=object())
          expect(GetSingleton()).toBe(GetSingleton())
          return GetSingleton()

        expect(LeafScope()).notToBeNone()
        # parent_singleton should attach to leaf because parent_val depends on
        # leaf_val
        expect(GetSingleton).toRaise(ValueError)
示例#25
0
  def it_should_work_with_super_classes_multiple_times(self):

    class Foo(object):
      def __init__(self):
        self.baz = 42

    class Bar(Foo):
      def __init__(self):
        super(Bar, self).__init__()

    expect(Bar().baz).toBe(42)
    expect(Bar().baz).toBe(42)
示例#26
0
  def it_should_support_singleton_functions(self):

    @ioc.Injectable
    @ioc.Singleton
    def singleton():  # pylint: disable=unused-variable
      return object()

    @ioc.Inject
    def ReturnSingleton(singleton=ioc.IN):
      return singleton

    expect(ReturnSingleton()).toBe(ReturnSingleton())
示例#27
0
文件: ioc_test.py 项目: yozo1984/dpy
  def it_should_work_with_super_classes_multiple_times(self):

    class Foo(object):
      def __init__(self):
        self.baz = 42

    class Bar(Foo):
      def __init__(self):
        super(Bar, self).__init__()

    expect(Bar().baz).toBe(42)
    expect(Bar().baz).toBe(42)
示例#28
0
  def it_should_allow_subclassing_injectables(self):

    @ioc.Inject
    class Foo(object):
      def __init__(self, bar=ioc.IN):
        self.bar = bar

    @ioc.Injectable
    class Bar(Foo): pass

    ioc.Injectable.value(bar=3)
    expect(Bar().bar).toBe(3)
示例#29
0
文件: ioc_test.py 项目: yozo1984/dpy
  def it_should_allow_subclassing_injectables(self):

    @ioc.Inject
    class Foo(object):
      def __init__(self, bar=ioc.IN):
        self.bar = bar

    @ioc.Injectable
    class Bar(Foo): pass

    ioc.Injectable.value(bar=3)
    expect(Bar().bar).toBe(3)
示例#30
0
文件: ioc_test.py 项目: yozo1984/dpy
  def it_should_support_singleton_functions(self):

    @ioc.Injectable
    @ioc.Singleton
    def singleton():  # pylint: disable=unused-variable
      return object()

    @ioc.Inject
    def ReturnSingleton(singleton=ioc.IN):
      return singleton

    expect(ReturnSingleton()).toBe(ReturnSingleton())
示例#31
0
文件: ioc_test.py 项目: yozo1984/dpy
  def it_should_support_multiple_threads(self):

    class T(ioc.threading.Thread):
      @ioc.Inject
      def run(self, bar=ioc.IN):
        self.setName(bar)

    ioc.Injectable.value(bar='baz')
    t = T()
    t.start()
    t.join()

    expect(t.name).toEqual('baz')
示例#32
0
  def it_should_support_multiple_threads(self):

    class T(ioc.threading.Thread):
      @ioc.Inject
      def run(self, bar=ioc.IN):
        self.setName(bar)

    ioc.Injectable.value(bar='baz')
    t = T()
    t.start()
    t.join()

    expect(t.name).toEqual('baz')
示例#33
0
文件: ioc_test.py 项目: yozo1984/dpy
  def it_should_override_name_in_parent_scope(self):
    ioc.Injectable.value(val=42)

    @ioc.Inject
    def GetVal(val=ioc.IN):
      return val

    @ioc.Scope
    def ScopedFunc():
      ioc.Injectable.value(val=32)
      return GetVal()

    expect(GetVal()).toBe(42)
    expect(ScopedFunc()).toBe(32)
示例#34
0
文件: ioc_test.py 项目: yozo1984/dpy
  def it_should_support_multiple_scopes(self):
    ioc.Injectable.value(root=99)

    @ioc.Inject
    def InjectedFunc(scoped=ioc.IN, root=ioc.IN):
      return scoped, root

    @ioc.Scope
    def ScopedFunc():
      ioc.Injectable.value(scoped=32)
      return InjectedFunc()

    expect(ScopedFunc()).toEqual((32, 99))
    expect(InjectedFunc).toRaise(ioc.InjectionMissingError)
示例#35
0
  def it_should_support_multiple_scopes(self):
    ioc.Injectable.value(root=99)

    @ioc.Inject
    def InjectedFunc(scoped=ioc.IN, root=ioc.IN):
      return scoped, root

    @ioc.Scope
    def ScopedFunc():
      ioc.Injectable.value(scoped=32)
      return InjectedFunc()

    expect(ScopedFunc()).toEqual((32, 99))
    expect(InjectedFunc).toRaise(ioc.InjectionMissingError)
示例#36
0
  def it_should_override_name_in_parent_scope(self):
    ioc.Injectable.value(val=42)

    @ioc.Inject
    def GetVal(val=ioc.IN):
      return val

    @ioc.Scope
    def ScopedFunc():
      ioc.Injectable.value(val=32)
      return GetVal()

    expect(GetVal()).toBe(42)
    expect(ScopedFunc()).toBe(32)
示例#37
0
文件: ioc_test.py 项目: yozo1984/dpy
    def it_should_attach_to_root(self):
      @ioc.Inject
      def GetSingleton(root_singleton=ioc.IN):
        return root_singleton

      @ioc.Scope
      def ParentScope():
        @ioc.Scope
        def LeafScope():
          # Get root_singleton for the first time inside leaf scope.
          return GetSingleton()
        return LeafScope()

      # The singleton value should attach to the root scope.
      expect(ParentScope()).toBe(GetSingleton())
示例#38
0
  def it_should_work_normally_for_non_injected_classes(self):

    class Foo(object):
      def __init__(self):
        self.baz = 42
      def method(self):
        return 99

    class Bar(Foo):
      def __init__(self):
        super(Bar, self).__init__()

    b = Bar()
    expect(b.baz).toBe(42)
    expect(b.method()).toBe(99)
示例#39
0
文件: ioc_test.py 项目: yozo1984/dpy
  def it_should_support_injectable_arg_in_singleton_functions(self):

    @ioc.Injectable
    @ioc.Singleton
    def singleton(val=ioc.IN):
      return val

    @ioc.Inject
    def ReturnSingletonVal(singleton=ioc.IN):
      return singleton

    val = object()
    ioc.Injectable.value(val=val)

    expect(ReturnSingletonVal()).toBe(val)
示例#40
0
文件: ioc_test.py 项目: yozo1984/dpy
  def it_should_support_eager_singletons(self):
    spy = create_spy('eager')

    @ioc.Injectable
    @ioc.Singleton.eager
    def singleton():  # pylint: disable=unused-variable
      spy()

    @ioc.Inject
    def ReturnSingleton(singleton=ioc.IN):
      return singleton
    ioc.Warmup()
    expect(spy.call_count).toBe(1)
    ReturnSingleton()
    expect(spy.call_count).toBe(1)
示例#41
0
文件: ioc_test.py 项目: yozo1984/dpy
  def it_should_support_singleton_classes(self):
    # pylint: disable=unused-variable

    @ioc.Injectable
    @ioc.Singleton
    class singleton(object):
      def __init__(self):
        self.bar = object()

    @ioc.Inject
    def ReturnSingleton(singleton=ioc.IN):
      return singleton

    expect(ReturnSingleton()).toBe(ReturnSingleton())
    expect(ReturnSingleton().bar).toBe(ReturnSingleton().bar)
示例#42
0
  def it_should_support_singleton_classes(self):
    # pylint: disable=unused-variable

    @ioc.Injectable
    @ioc.Singleton
    class singleton(object):
      def __init__(self):
        self.bar = object()

    @ioc.Inject
    def ReturnSingleton(singleton=ioc.IN):
      return singleton

    expect(ReturnSingleton()).toBe(ReturnSingleton())
    expect(ReturnSingleton().bar).toBe(ReturnSingleton().bar)
示例#43
0
  def it_should_support_injectable_arg_in_singleton_functions(self):

    @ioc.Injectable
    @ioc.Singleton
    def singleton(val=ioc.IN):
      return val

    @ioc.Inject
    def ReturnSingletonVal(singleton=ioc.IN):
      return singleton

    val = object()
    ioc.Injectable.value(val=val)

    expect(ReturnSingletonVal()).toBe(val)
示例#44
0
文件: ioc_test.py 项目: yozo1984/dpy
  def it_should_work_normally_for_non_injected_classes(self):

    class Foo(object):
      def __init__(self):
        self.baz = 42
      def method(self):
        return 99

    class Bar(Foo):
      def __init__(self):
        super(Bar, self).__init__()

    b = Bar()
    expect(b.baz).toBe(42)
    expect(b.method()).toBe(99)
示例#45
0
  def it_should_support_eager_singletons(self):
    spy = create_spy('eager')

    @ioc.Injectable
    @ioc.Singleton.eager
    def singleton():  # pylint: disable=unused-variable
      spy()

    @ioc.Inject
    def ReturnSingleton(singleton=ioc.IN):
      return singleton
    ioc.Warmup()
    expect(spy.call_count).toBe(1)
    ReturnSingleton()
    expect(spy.call_count).toBe(1)
示例#46
0
    def it_should_attach_to_root(self):
      @ioc.Inject
      def GetSingleton(root_singleton=ioc.IN):
        return root_singleton

      @ioc.Scope
      def ParentScope():
        @ioc.Scope
        def LeafScope():
          # Get root_singleton for the first time inside leaf scope.
          return GetSingleton()
        return LeafScope()

      # The singleton value should attach to the root scope.
      expect(ParentScope()).toBe(GetSingleton())
示例#47
0
文件: ioc_test.py 项目: yozo1984/dpy
  def it_should_support_injectable_arg_in_singleton_classes(self):
    # pylint: disable=unused-variable

    @ioc.Injectable
    @ioc.Singleton
    class singleton(object):
      def __init__(self, val=ioc.IN):
        self.val = val

    @ioc.Inject
    def ReturnSingleton(singleton=ioc.IN):
      return singleton

    val = object()
    ioc.Injectable.value(val=val)

    expect(ReturnSingleton()).toBe(ReturnSingleton())
    expect(ReturnSingleton().val).toBe(val)
示例#48
0
  def it_should_support_injectable_arg_in_singleton_classes(self):
    # pylint: disable=unused-variable

    @ioc.Injectable
    @ioc.Singleton
    class singleton(object):
      def __init__(self, val=ioc.IN):
        self.val = val

    @ioc.Inject
    def ReturnSingleton(singleton=ioc.IN):
      return singleton

    val = object()
    ioc.Injectable.value(val=val)

    expect(ReturnSingleton()).toBe(ReturnSingleton())
    expect(ReturnSingleton().val).toBe(val)
示例#49
0
  def it_should_tolerate_layering_injection_wrappers(self):

    def InjectInjectable():
      @ioc.Inject
      @ioc.Injectable
      def foo(baz=ioc.IN):  # pylint: disable=unused-variable
        return baz

    def InjectableInject():
      @ioc.Injectable
      @ioc.Inject
      def bar(baz=ioc.IN):  # pylint: disable=unused-variable
        return baz

    ioc.Injectable.value(baz=42)  # To ensure that foo is wrapped.

    expect(InjectInjectable).notToRaise(AssertionError)
    expect(InjectableInject).notToRaise(AssertionError)
示例#50
0
文件: ioc_test.py 项目: yozo1984/dpy
  def it_should_tolerate_layering_injection_wrappers(self):

    def InjectInjectable():
      @ioc.Inject
      @ioc.Injectable
      def foo(baz=ioc.IN):  # pylint: disable=unused-variable
        return baz

    def InjectableInject():
      @ioc.Injectable
      @ioc.Inject
      def bar(baz=ioc.IN):  # pylint: disable=unused-variable
        return baz

    ioc.Injectable.value(baz=42)  # To ensure that foo is wrapped.

    expect(InjectInjectable).notToRaise(AssertionError)
    expect(InjectableInject).notToRaise(AssertionError)
示例#51
0
    def it_should_attach_to_parent(self):
      @ioc.Inject
      def GetSingleton(parent_singleton=ioc.IN):
        return parent_singleton

      @ioc.Scope
      def ParentScope():
        ioc.Injectable.value(parent_val=object())

        @ioc.Scope
        def LeafScope():
          # Get parent_singleton for the first time inside leaf scope.
          return GetSingleton()
        # The singleton should stay the same even leaf scope is popped.
        expect(LeafScope()).toBe(GetSingleton())

      ParentScope()
      # parent_singleton should have been popped.
      expect(GetSingleton).toRaise(ValueError)
示例#52
0
文件: ioc_test.py 项目: yozo1984/dpy
    def it_should_attach_to_parent(self):
      @ioc.Inject
      def GetSingleton(parent_singleton=ioc.IN):
        return parent_singleton

      @ioc.Scope
      def ParentScope():
        ioc.Injectable.value(parent_val=object())

        @ioc.Scope
        def LeafScope():
          # Get parent_singleton for the first time inside leaf scope.
          return GetSingleton()
        # The singleton should stay the same even leaf scope is popped.
        expect(LeafScope()).toBe(GetSingleton())

      ParentScope()
      # parent_singleton should have been popped.
      expect(GetSingleton).toRaise(ValueError)
示例#53
0
  def it_should_support_super_class_testing(self):

    @ioc.Inject
    class Foo(object):
      def __init__(self, baz=ioc.IN):
        self.baz = baz
      def method(self):
        return 99

    @ioc.Injectable
    class Bar(Foo):
      def __init__(self):
        super(Bar, self).__init__()

    ioc.SetUpTestInjections(baz=32)
    ioc.Injectable.value(baz=42)

    b = Bar()
    expect(b.baz).toBe(32)
    expect(b.method()).toBe(99)
示例#54
0
    def it_should_save_injectable_singleton_class(self):
      @ioc.Inject
      class RootInstance(object):
        def __init__(self, parent=ioc.IN):
          self.value = parent.value

      @ioc.Injectable.named('parent')
      @ioc.Singleton
      class ParentSingleton(object):
        def __init__(self, leaf_instance=ioc.IN):
          self.value = leaf_instance.value

      @ioc.Injectable.named('leaf_instance')
      class LeafInstance(object):
        value = 'Leaf Instance'

        def __init__(self):
          pass

      expect(RootInstance().value).toBe(LeafInstance.value)
示例#55
0
文件: ioc_test.py 项目: yozo1984/dpy
  def it_should_support_super_class_testing(self):

    @ioc.Inject
    class Foo(object):
      def __init__(self, baz=ioc.IN):
        self.baz = baz
      def method(self):
        return 99

    @ioc.Injectable
    class Bar(Foo):
      def __init__(self):
        super(Bar, self).__init__()

    ioc.SetUpTestInjections(baz=32)
    ioc.Injectable.value(baz=42)

    b = Bar()
    expect(b.baz).toBe(32)
    expect(b.method()).toBe(99)
示例#56
0
文件: ioc_test.py 项目: yozo1984/dpy
    def it_should_save_injectable_singleton_class(self):
      @ioc.Inject
      class RootInstance(object):
        def __init__(self, parent=ioc.IN):
          self.value = parent.value

      @ioc.Injectable.named('parent')
      @ioc.Singleton
      class ParentSingleton(object):
        def __init__(self, leaf_instance=ioc.IN):
          self.value = leaf_instance.value

      @ioc.Injectable.named('leaf_instance')
      class LeafInstance(object):
        value = 'Leaf Instance'

        def __init__(self):
          pass

      expect(RootInstance().value).toBe(LeafInstance.value)
示例#57
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')
示例#58
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')
示例#59
0
 def it_should_hello(self):
     msg = example.hello(greet='Greeting',
                         app_name='Hello Method',
                         user='******')
     jazz.expect(msg).toEqual('<p>Hello Method: Greeting Test User</p>')
示例#60
0
文件: ioc_test.py 项目: yozo1984/dpy
 def LeafScope():
   ioc.Injectable.value(leaf_val=object())
   expect(GetSingleton()).toBe(GetSingleton())
   return GetSingleton()