class ResultsTestCases(unittest.TestCase): """class for results tests""" def setUp(self): # Mocks self.result1 = MagicMock() self.result2 = MagicMock() self.results = Results([self.result1, self.result2]) def test_set_up_calls_each_result_set_up(self): """stuff""" self.results.set_up() self.assertTrue(self.result1.set_up.called) self.assertTrue(self.result2.set_up.called) def test_tear_down_calls_each_result_tear_down(self): """stuff""" self.results.tear_down() self.assertTrue(self.result1.tear_down.called) self.assertTrue(self.result2.tear_down.called) def test_actual_and_expected_result_calls_each_actual_and_expected_result(self): """stuff""" for _ in self.results.actual_and_expected_results(): pass self.assertTrue(self.result1.actual_and_expected_result.called) self.assertTrue(self.result2.actual_and_expected_result.called)
def setUp(self): # Mocks self.result1 = MagicMock() self.result2 = MagicMock() self.results = Results([ self.result1, self.result2, ])
class ResultsTestCases(unittest.TestCase): """class for results tests""" def setUp(self): # Mocks self.result1 = MagicMock() self.result2 = MagicMock() self.results = Results([ self.result1, self.result2, ]) def test_set_up_calls_each_result_set_up(self): """stuff""" self.results.set_up() self.assertTrue(self.result1.set_up.called) self.assertTrue(self.result2.set_up.called) def test_tear_down_calls_each_result_tear_down(self): """stuff""" self.results.tear_down() self.assertTrue(self.result1.tear_down.called) self.assertTrue(self.result2.tear_down.called) def test_actual_and_expected_result_calls_each_actual_and_expected_result( self): """stuff""" for _ in self.results.actual_and_expected_results(): pass self.assertTrue(self.result1.actual_and_expected_result.called) self.assertTrue(self.result2.actual_and_expected_result.called)
def setUp(self): # Mocks self.result1 = MagicMock() self.result2 = MagicMock() self.results = Results([self.result1, self.result2])