Ejemplo n.º 1
0
 def test_mismatch_does_not_implement(self):
     obj = ProxyFactory(object(), checker=NamesChecker())
     matcher = ProvidesAndIsProxied(ITestInterface)
     self.assertIsInstance(matcher.match(obj), DoesNotProvide)
Ejemplo n.º 2
0
 def test_mismatch_unproxied(self):
     obj = Implementor()
     matcher = ProvidesAndIsProxied(ITestInterface)
     self.assertIsInstance(matcher.match(obj), IsNotProxied)
Ejemplo n.º 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))
Ejemplo n.º 4
0
 def test_mismatch_does_not_implement(self):
     obj = ProxyFactory(object(), checker=NamesChecker())
     matcher = ProvidesAndIsProxied(ITestInterface)
     self.assertIsInstance(matcher.match(obj), DoesNotProvide)
Ejemplo n.º 5
0
 def test_mismatch_unproxied(self):
     obj = Implementor()
     matcher = ProvidesAndIsProxied(ITestInterface)
     self.assertIsInstance(matcher.match(obj), IsNotProxied)
Ejemplo n.º 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))