def test_get_test_history_returns_when_the_end_revision_is_given(self, EvergreenApi): def get_history_mock(project, params): return [{"revision": "end"}] EvergreenApi.get_history = get_history_mock grs.get_test_history(EvergreenApi, grs.ProjectTarget('', '', ''), '', grs.CommitRange('start', 'end'), None)
def test_get_test_history_can_be_called_multiple_times(self, EvergreenApi): call_data = {"count": 0} def get_history_mock(project, params): returnValue = [ "nottheend", "end", ] call_data["count"] += 1 return [{"revision": returnValue[call_data["count"] - 1]}] EvergreenApi.get_history = get_history_mock grs.get_test_history(EvergreenApi, grs.ProjectTarget('', '', ''), '', grs.CommitRange('start', 'end'), None) self.assertEqual(call_data["count"], 2)