File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1818 'color' : '\033 [97m' }
1919 }
2020
21- #'green': '\033[92m',
21+ # 'green': '\033[92m',
2222
2323
2424ENDCOLLOR = '\033 [0m'
Original file line number Diff line number Diff line change 1111
1212import jenkins
1313
14- from jenkins_cli .cli import JenkinsCli , CliException , COLORS
14+ from jenkins_cli .cli import JenkinsCli , CliException , STATUSES , ENDCOLLOR
1515
1616GIT_SCM_XML = """<?xml version=\' 1.0\' encoding=\' UTF-8\' ?>\n <project>\n <actions/>\n <description></description>\n <keepDependencies>false</keepDependencies>\n <properties/>\n <scm class="hudson.plugins.git.GitSCM" plugin="git@2.4.2">\n <configVersion>2</configVersion>\n <userRemoteConfigs>\n <hudson.plugins.git.UserRemoteConfig>\n <url>https://github.com/LD250/jenkins-cli-python/</url>\n </hudson.plugins.git.UserRemoteConfig>\n </userRemoteConfigs>\n <branches>\n <hudson.plugins.git.BranchSpec>\n <name>cli-tests</name>\n </hudson.plugins.git.BranchSpec>\n </branches>\n <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>\n <submoduleCfg class="list"/>\n <extensions/>\n </scm>\n <canRoam>true</canRoam>\n <disabled>false</disabled>\n <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>\n <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>\n <triggers/>\n <concurrentBuild>false</concurrentBuild>\n <builders>\n <hudson.tasks.Shell>\n <command></command>\n </hudson.tasks.Shell>\n <jenkins.plugins.shiningpanda.builders.VirtualenvBuilder plugin="shiningpanda@0.22">\n <pythonName>System-CPython-2.7</pythonName>\n <home></home>\n <clear>true</clear>\n <systemSitePackages>false</systemSitePackages>\n <nature>shell</nature>\n <command>pip install -U pip\n pip install -U setuptools\n pip install -U wheel\n pip install -r requirements.txt\n pip list -o\n \n flake8 jenkins_cli\n python setup.py test</command>\n <ignoreExitCode>false</ignoreExitCode>\n </jenkins.plugins.shiningpanda.builders.VirtualenvBuilder>\n </builders>\n <publishers/>\n <buildWrappers/>\n </project>
1717"""
@@ -135,8 +135,8 @@ def test_jobs(self, patched_get_jobs):
135135 patched_get_jobs .return_value = jobs
136136 self .args .a = False
137137 JenkinsCli (self .args ).jobs (self .args )
138- arg1 = "%s*** %s Job1" % (COLORS . get ( jobs [0 ]['color' ], jobs [ 0 ]['color' ]), COLORS [ 'endcollor' ] )
139- arg2 = "%s*** %s Job2" % (COLORS . get ( jobs [1 ]['color' ], jobs [ 1 ]['color' ]), COLORS [ 'endcollor' ] )
138+ arg1 = "%sS.. %s Job1" % (STATUSES [ jobs [0 ]['color' ]]['color' ], ENDCOLLOR )
139+ arg2 = "%sD.. %s Job2" % (STATUSES [ jobs [1 ]['color' ]]['color' ], ENDCOLLOR )
140140 self .patched_print .assert_has_calls ([mock .call (arg1 )], [mock .call (arg2 )])
141141 self .patched_print .reset_mock ()
142142 self .args .a = True
You can’t perform that action at this time.
0 commit comments