Example #1
0
 def test060_and_match(self):
     spy = SinonSpy()
     stub = SinonStub()
     m = SinonMatcher.instanceOf(spy).and_match(
         SinonMatcher.instanceOf(stub))
     self.assertFalse(m.mtest(spy))
     self.assertTrue(m.mtest(stub))
Example #2
0
 def test51_instanceOf_instance(self):
     spy = SinonSpy()
     stub = SinonStub()
     m = SinonMatcher.instanceOf(spy)
     self.assertTrue(m.mtest(spy))
     self.assertTrue(m.mtest(stub))
Example #3
0
 def test50_instanceOf_class(self):
     fto = ForTestOnly()
     with self.assertRaises(Exception) as context:
         m = SinonMatcher.instanceOf(ForTestOnly)