Ejemplo n.º 1
0
    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)
Ejemplo n.º 2
0
    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)
Ejemplo n.º 3
0
    def test_get_history_by_revision_call_evergreen(self, EvergreenApi):
        grs.get_history_by_revision(EvergreenApi, '',
                                    grs.CommitRange('start', 'end'), '', None)

        self.assertTrue(EvergreenApi.get_history.called)