5 class TestPie(unittest.TestCase):
10 verify(mock, never()).fakeMethod()
12 def test_neverFail(self):
17 verify(mock, never()).fakeMethod()
18 raise Exception("The fake method was called - the verify statement should fail")
22 def test_onceSuccess(self):
24 given(mock).method().willReturn(True)
26 result = mock.method()
28 verify(mock, once()).method()
30 def test_onceFail(self):
32 given(mock).method().willReturn(True)
35 verify(mock, once()).method()
36 raise Exception("The method was never called - the verify step should fail")
40 def test_implicitOnce_undefinedReturn_WithArguments(self):
43 url = 'http://sample.argument'
45 verify(mock).openUrl(url)
47 if __name__ == '__main__':