Esempio n. 1
0
 def testCheckNoErrorsSuccess(self, mock_get_junit, mock_get_failures):
     # Verify that check no errors returns true when there are no errors
     gcs_client = mock.MagicMock(spec=storage.Client)
     artifacts_dir = "gs://some_dir"
     mock_get_junit.return_value = set(["junit_1.xml"])
     mock_get_failures.return_value = 0
     self.assertTrue(
         prow_artifacts.check_no_errors(gcs_client, artifacts_dir))
Esempio n. 2
0
 def testCheckNoErrorsFailure(self, mock_get_junit, mock_get_failures):
     # Verify that check no errors returns false when a junit
     # file reports an error.
     gcs_client = mock.MagicMock(spec=storage.Client)
     artifacts_dir = "gs://some_dir"
     mock_get_junit.return_value = set(["junit_1.xml"])
     mock_get_failures.return_value = 1
     self.assertFalse(
         prow_artifacts.check_no_errors(gcs_client, artifacts_dir))