From d7431f365012c535a817a439a52668605be0b1c5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Victor=20Garc=C3=ADa?= Date: Tue, 12 Feb 2013 12:37:21 +0100 Subject: [PATCH] adding STATUS_SUCCESS constant instead of hardcoded string --- jenkinsapi/build.py | 4 ++-- jenkinsapi/constants.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/jenkinsapi/build.py b/jenkinsapi/build.py index 254fc54..930eb83 100644 --- a/jenkinsapi/build.py +++ b/jenkinsapi/build.py @@ -2,7 +2,7 @@ from jenkinsapi.artifact import Artifact from jenkinsapi import config from jenkinsapi.jenkinsbase import JenkinsBase from jenkinsapi.exceptions import NoResults, FailedNoResults -from jenkinsapi.constants import STATUS_FAIL, STATUS_ABORTED, RESULTSTATUS_FAILURE +from jenkinsapi.constants import STATUS_FAIL, STATUS_ABORTED, RESULTSTATUS_FAILURE, STATUS_SUCCESS from jenkinsapi.result_set import ResultSet from time import sleep @@ -211,7 +211,7 @@ class Build(JenkinsBase): Return a bool, true if the build was good. If the build is still running, return False. """ - return ( not self.is_running() ) and self._data["result"] == 'SUCCESS' + return ( not self.is_running() ) and self._data["result"] == STATUS_SUCCESS def block_until_complete(self, delay=15): assert isinstance( delay, int ) diff --git a/jenkinsapi/constants.py b/jenkinsapi/constants.py index 570148c..9489e20 100644 --- a/jenkinsapi/constants.py +++ b/jenkinsapi/constants.py @@ -4,6 +4,7 @@ STATUS_FAIL = "FAIL" STATUS_ERROR = "ERROR" STATUS_ABORTED = "ABORTED" STATUS_REGRESSION = "REGRESSION" +STATUS_SUCCESS = "SUCCESS" STATUS_FIXED = "FIXED" STATUS_PASSED = "PASSED" -- 2.7.4