Ejemplo n.º 1
0
 def test_get_tests_uncaught_http_error(self):
     http_error_code = 401
     test_tasks = TaskTests(TASKS_TESTS, http_error_code=http_error_code)
     evg_api = Mock()
     evg_api.tests_by_task = test_tasks._tests_by_task
     with self.assertRaises(requests.exceptions.HTTPError) as err:
         burn_in.get_tests_from_tasks(evg_api, BUILD4_TASKS)
         self.assertEqual(1, test_tasks.http_errors)
         self.assertEqual(http_error_code, err.response.status_code)
Ejemplo n.º 2
0
 def test_get_tests_uncaught_http_error(self):
     http_error_code = 401
     test_tasks = TaskTests(TASKS_TESTS, http_error_code=http_error_code)
     evg_api = Mock()
     evg_api.tests_by_task = test_tasks._tests_by_task
     with self.assertRaises(requests.exceptions.HTTPError) as err:
         burn_in.get_tests_from_tasks(evg_api, BUILD4_TASKS)
         self.assertEqual(1, test_tasks.http_errors)
         self.assertEqual(http_error_code, err.response.status_code)
Ejemplo n.º 3
0
 def test_get_tests(self):
     test_tasks = TaskTests(TASKS_TESTS)
     evg_api = Mock()
     evg_api.tests_by_task = test_tasks._tests_by_task
     tests = burn_in.get_tests_from_tasks(evg_api, BUILD_TASKS_WITH_BURN_IN_LIST)
     self.assertEqual(5, len(tests))
     for test in tests:
         self.assertIn(test, ["test1.js", "test2.js"])
Ejemplo n.º 4
0
 def test_get_tests(self):
     test_tasks = TaskTests(TASKS_TESTS)
     evg_api = Mock()
     evg_api.tests_by_task = test_tasks._tests_by_task
     tests = burn_in.get_tests_from_tasks(evg_api,
                                          BUILD_TASKS_WITH_BURN_IN_LIST)
     self.assertEqual(5, len(tests))
     for test in tests:
         self.assertIn(test, ["test1.js", "test2.js"])
Ejemplo n.º 5
0
 def test_get_tests_missing_task(self):
     test_tasks = TaskTests(TASKS_TESTS)
     evg_api = Mock()
     evg_api.tests_by_task = test_tasks._tests_by_task
     tests = burn_in.get_tests_from_tasks(evg_api, BUILD2_TASKS)
     self.assertEqual(0, len(tests))
Ejemplo n.º 6
0
 def test_get_tests_no_tasks(self):
     test_tasks = TaskTests(TASKS_TESTS)
     evg_api = Mock()
     evg_api.tests_by_task = test_tasks._tests_by_task
     tests = burn_in.get_tests_from_tasks(evg_api, [])
     self.assertEqual(0, len(tests))
Ejemplo n.º 7
0
 def test_get_tests_missing_task(self):
     test_tasks = TaskTests(TASKS_TESTS)
     evg_api = Mock()
     evg_api.tests_by_task = test_tasks._tests_by_task
     tests = burn_in.get_tests_from_tasks(evg_api, BUILD2_TASKS)
     self.assertEqual(0, len(tests))
Ejemplo n.º 8
0
 def test_get_tests_no_tasks(self):
     test_tasks = TaskTests(TASKS_TESTS)
     evg_api = Mock()
     evg_api.tests_by_task = test_tasks._tests_by_task
     tests = burn_in.get_tests_from_tasks(evg_api, [])
     self.assertEqual(0, len(tests))