예제 #1
0
    def test_with_class_with_getattr(self):
        class SomeClass(object):
            def __getattr__(self, _):
                return False

        self.assertFalse(providers.is_provider(SomeClass()))
 def test_is_provider(self):
     self.assertTrue(
         providers.is_provider(providers.DelegatedFactory(object)))
def test_is_provider():
    assert providers.is_provider(providers.Object(object())) is True
예제 #4
0
 def test_is_provider(self):
     self.assertTrue(providers.is_provider(self.singleton_cls(Example)))
예제 #5
0
 def test_is_provider(self):
     self.assertTrue(providers.is_provider(providers.Resource(init_fn)))
예제 #6
0
 def test_is_provider(self):
     self.assertTrue(providers.is_provider(self.delegate))
예제 #7
0
 def test_is_provider(self):
     self.assertTrue(providers.is_provider(self.factory_aggregate))
def test_is_provider(provider):
    assert providers.is_provider(provider) is True
 def test_is_provider(self):
     self.assertTrue(
         providers.is_provider(providers.DelegatedCoroutine(_example)))
예제 #10
0
def test_is_provider(delegate):
    assert providers.is_provider(delegate) is True
 def test_is_provider(self):
     self.assertTrue(
         providers.is_provider(providers.DelegatedCallable(_example)))
예제 #12
0
def test_is_provider():
    assert providers.is_provider(providers.Factory(Example)) is True
예제 #13
0
def test_is_provider():
    assert providers.is_provider(providers.DelegatedFactory(object)) is True
예제 #14
0
def test_is_provider():
    assert providers.is_provider(providers.Self()) is True
예제 #15
0
def test_is_provider():
    assert providers.is_provider(providers.Callable(example)) is True
def test_with_string():
    assert providers.is_provider("some_string") is False
예제 #17
0
 def test_is_provider(self):
     self.assertTrue(providers.is_provider(providers.Object(object())))
def test_with_object():
    assert providers.is_provider(object()) is False
예제 #19
0
 def test_is_provider(self):
     self.assertTrue(providers.is_provider(self.provider))
def test_with_subclass_instance():
    class SomeProvider(providers.Provider):
        pass

    assert providers.is_provider(SomeProvider()) is True
 def test_is_provider(self):
     self.assertTrue(providers.is_provider(providers.List()))
def test_with_class_with_getattr():
    class SomeClass(object):
        def __getattr__(self, _):
            return False

    assert providers.is_provider(SomeClass()) is False
def test_is_provider():
    assert providers.is_provider(providers.Resource(init_fn)) is True
def test_with_instance():
    assert providers.is_provider(providers.Provider()) is True
 def test_is_provider(self):
     self.assertTrue(providers.is_provider(providers.Factory(Example)))
def test_with_class():
    assert providers.is_provider(providers.Provider) is False
 def test_is_provider(self):
     self.assertTrue(providers.is_provider(self.container.service.provided))
 def test_is_provider(self):
     self.assertTrue(
         providers.is_provider(providers.Selector(self.selector)))
 def test_providers_are_providers(self):
     self.assertTrue(providers.is_provider(self.config.a))
     self.assertTrue(providers.is_provider(self.config.a.b))
     self.assertTrue(providers.is_provider(self.config.a.b.c))
     self.assertTrue(providers.is_provider(self.config.a.b.d))
예제 #30
0
    def test_with_subclass_instance(self):
        class SomeProvider(providers.Provider):
            pass

        self.assertTrue(providers.is_provider(SomeProvider()))