Пример #1
0
 def test_mismatch_does_not_implement(self):
     obj = ProxyFactory(object(), checker=NamesChecker())
     matcher = ProvidesAndIsProxied(ITestInterface)
     self.assertIsInstance(matcher.match(obj), DoesNotProvide)
Пример #2
0
 def test_mismatch_unproxied(self):
     obj = Implementor()
     matcher = ProvidesAndIsProxied(ITestInterface)
     self.assertIsInstance(matcher.match(obj), IsNotProxied)
Пример #3
0
 def test_match(self):
     obj = ProxyFactory(
         Implementor(), checker=NamesChecker(names=("doFoo", )))
     matcher = ProvidesAndIsProxied(ITestInterface)
     self.assertThat(obj, matcher)
     self.assertEqual(None, matcher.match(obj))
Пример #4
0
 def test_mismatch_does_not_implement(self):
     obj = ProxyFactory(object(), checker=NamesChecker())
     matcher = ProvidesAndIsProxied(ITestInterface)
     self.assertIsInstance(matcher.match(obj), DoesNotProvide)
Пример #5
0
 def test_mismatch_unproxied(self):
     obj = Implementor()
     matcher = ProvidesAndIsProxied(ITestInterface)
     self.assertIsInstance(matcher.match(obj), IsNotProxied)
Пример #6
0
 def test_match(self):
     obj = ProxyFactory(
         Implementor(), checker=NamesChecker(names=("doFoo", )))
     matcher = ProvidesAndIsProxied(ITestInterface)
     self.assertThat(obj, matcher)
     self.assertEqual(None, matcher.match(obj))