Beispiel #1
0
 def test_get_jobs_wrong_group(self):
     """ Negative test - Confirm we cannot get jobs for a group we cannot access """
     response = compute.get_jobs(
         environment.ATHERA_API_TEST_BASE_URL,
         environment.ATHERA_API_TEST_OTHER_GROUP_ID,
         self.token
     )
     self.assertEqual(response.status_code, codes.forbidden)
Beispiel #2
0
 def test_get_jobs_bad_group(self):
     """ Negative test - Confirm we handle bad group id """
     response = compute.get_jobs(
         environment.ATHERA_API_TEST_BASE_URL,
         "cheddar",
         self.token
     )
     self.assertEqual(response.status_code, codes.internal_server_error)
Beispiel #3
0
 def test_get_jobs(self):
     """ Positive test """
     response = compute.get_jobs(environment.ATHERA_API_TEST_BASE_URL,
                                 environment.ATHERA_API_TEST_GROUP_ID,
                                 environment.ATHERA_API_TEST_TOKEN)
     self.assertEqual(response.status_code, codes.ok)
     data = response.json()
     job_data = data['jobs']
     self.assertNotEqual(len(job_data), 0)
     first_job = job_data[0]
     self.assertNotEqual(len(first_job), 0)
     self.assertIn("id", first_job)