Пример #1
0
    def test_get_job(self):
        tdc = TreeherderClient()
        url = tdc._get_project_uri("mozilla-inbound", tdc.JOBS_ENDPOINT)
        content = {"meta": {"count": 3, "repository": "mozilla-inbound", "offset": 0}, "results": self.JOB_RESULTS}
        responses.add(responses.GET, url, json=content, match_querystring=True, status=200)

        jobs = tdc.get_jobs("mozilla-inbound")
        self.assertEqual(len(jobs), 3)
        self.assertEqual(jobs, self.JOB_RESULTS)
Пример #2
0
    def test_get_job(self, mock_get):

        mock_get.return_value = self._get_mock_response({
            "meta": {"count": 3,
                     "repository": "mozilla-inbound",
                     "offset": 0},
            "results": self.JOB_RESULTS})
        tdc = TreeherderClient()
        jobs = tdc.get_jobs("mozilla-inbound")
        self.assertEqual(len(jobs), 3)
        self.assertEqual(jobs, self.JOB_RESULTS)
    def test_get_job(self, mock_get):

        mock_get.return_value = self._get_mock_response({
            "meta": {
                "count": 3,
                "repository": "mozilla-inbound",
                "offset": 0
            },
            "results":
            self.JOB_RESULTS
        })
        tdc = TreeherderClient()
        jobs = tdc.get_jobs("mozilla-inbound")
        self.assertEqual(len(jobs), 3)
        self.assertEqual(jobs, self.JOB_RESULTS)
Пример #4
0
    def test_get_job(self):
        tdc = TreeherderClient()
        url = tdc._get_endpoint_url(tdc.JOBS_ENDPOINT,
                                    project='mozilla-inbound')
        content = {
            "meta": {
                "count": 3,
                "repository": "mozilla-inbound",
                "offset": 0
            },
            "results": self.JOB_RESULTS
        }
        responses.add(responses.GET,
                      url,
                      json=content,
                      match_querystring=True,
                      status=200)

        jobs = tdc.get_jobs("mozilla-inbound")
        self.assertEqual(len(jobs), 3)
        self.assertEqual(jobs, self.JOB_RESULTS)