def test_notification_ignores_completed_but_not_finished_steps(self): jenkins_json = self.buildJenkinsNotificationJson("step1", phase="COMPLETED", status="FAILED") notification = JenkinsNotification(jenkins_json) notification.update_pipeline(self.pipeline) self.assertEqual(len(self.pipeline.mock_calls), 0)
def test_notification_updates_passing_pipeline_steps(self): jenkins_json = self.buildJenkinsNotificationJson("step1", phase="FINISHED", status="SUCCESS") notification = JenkinsNotification(jenkins_json) notification.update_pipeline(self.pipeline) self.assertEqual(len(self.pipeline.mock_calls), 1) self.pipeline.pass_step.assert_called_once_with("step1")
def test_notification_updates_starting_pipeline_steps_ignoring_previous_errors(self): jenkins_json = self.buildJenkinsNotificationJson("step1", phase="STARTED", status="FAILED") notification = JenkinsNotification(jenkins_json) notification.update_pipeline(self.pipeline) self.assertEqual(len(self.pipeline.mock_calls), 1) self.pipeline.start_step.assert_called_once_with("step1")