def test_jobs_count_no_active(self): httpretty.register_uri( httpretty.GET, self.url_endpoint, body=""" {"jobs": [ {"id": 1, "state": "passed"}, {"id": 2, "state": "passed"}, {"id": 3, "state": "failed"} ] } """, ) jobs = get_active_jobs(11122) self.assertEqual(0, len(jobs))
def test_jobs_count(self): httpretty.register_uri( httpretty.GET, self.url_endpoint, body=""" {"jobs": [ {"id": 1, "state": "received"}, {"id": 2, "state": "created"} ] } """, ) jobs = get_active_jobs(11122) expected_job_list = [ {u'id': 1, u'state': u'received'}, {u'id': 2, u'state': u'created'} ] self.assertListEqual(expected_job_list, jobs)
def test_jobs_count(self): httpretty.register_uri( httpretty.GET, self.url_endpoint, body=""" {"jobs": [ {"id": 1, "state": "received"}, {"id": 2, "state": "created"} ] } """, ) jobs = get_active_jobs(11122) expected_job_list = [{ 'id': 1, 'state': 'received' }, { 'id': 2, 'state': 'created' }] self.assertListEqual(expected_job_list, jobs)