def test_call_count(self): s = Spy('str') s.upper() self.assertEqual(1, s.upper.call_count()) s.lower() self.assertEqual(1, s.upper.call_count()) s.upper() self.assertEqual(2, s.upper.call_count())
def test_all_calls_args_flatten(self): s = Spy('str') s.replace('t', 'T') s.upper() s.lower(1) self.assertEqual(['t', 'T', 1], s.all_calls_args_flatten())
def test_all_calls_args(self): s = Spy('str') s.replace('t', 'T') s.upper() s.lower(1) self.assertEqual([('t', 'T'), (), (1, )], s.all_calls_args())