def test_runs_each_time_a_change_is_detected(self): runs = 10 fake_monitor = self.FakeMonitor(look_for_changes_returns=([True] * runs)) pytddmon = Pytddmon(self.fake_filefinder, fake_monitor) for _ in range(runs): pytddmon.main() self.assertEqual(runs + 1, self.number_of_test_runs)
def _set_up_pytddmon(self, params): fake_monitor = self.FakeMonitor(look_for_changes_returns=params) pytddmon = Pytddmon(self.fake_filefinder, fake_monitor) pytddmon.main() return pytddmon
def test_total_tests_is_zero_if_no_tests_are_run(self): fake_monitor = self.FakeMonitor(look_for_changes_returns = [False]) pytddmon = Pytddmon(self.fake_filefinder, fake_monitor) pytddmon.main() self.assertEqual(0, pytddmon.result.total)
def test_doesnt_run_tests_when_no_change(self): fake_monitor = self.FakeMonitor(look_for_changes_returns = [True, False]) pytddmon = Pytddmon(self.fake_filefinder, fake_monitor) pytddmon.main() pytddmon.main() self.assertEqual(2, self.number_of_test_runs)
def test_runs_tests_when_change_detected(self): fake_monitor = self.FakeMonitor(look_for_changes_returns = [True]) pytddmon = Pytddmon(self.fake_filefinder, fake_monitor) pytddmon.main() self.assertEqual(2, self.number_of_test_runs)
def test_runs_tests_at_boot(self): fake_monitor = self.FakeMonitor(look_for_changes_returns = [False]) pytddmon = Pytddmon(self.fake_filefinder, fake_monitor) pytddmon.main() self.assertEqual(1, self.number_of_test_runs)