コード例 #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))