summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-10-27 20:59:02 +0000
committerGerrit Code Review <review@openstack.org>2016-10-27 20:59:03 +0000
commitf0c99b70a717264304ef30dd781687c4a4982869 (patch)
tree595f03ef6784103cad13766b0f797b2d1685b46a
parent771a94227ce6b1ed718f64a782d09e9c675c6735 (diff)
parent4b63891dd72163a1cd206263961924df1593baf4 (diff)
downloadpython-jenkins-job-builder-f0c99b70a717264304ef30dd781687c4a4982869.tar.gz
python-jenkins-job-builder-f0c99b70a717264304ef30dd781687c4a4982869.tar.xz
python-jenkins-job-builder-f0c99b70a717264304ef30dd781687c4a4982869.zip
Merge "user's input should not be interpreted"
-rw-r--r--jenkins_jobs/utils.py1
-rw-r--r--tests/cmd/subcommands/test_delete_all.py8
2 files changed, 3 insertions, 6 deletions
diff --git a/jenkins_jobs/utils.py b/jenkins_jobs/utils.py
index 4e28ad25..385f87ba 100644
--- a/jenkins_jobs/utils.py
+++ b/jenkins_jobs/utils.py
@@ -19,6 +19,7 @@ import codecs
import fnmatch
import locale
import os.path
+from six.moves import input
def wrap_stream(stream, encoding='utf-8'):
diff --git a/tests/cmd/subcommands/test_delete_all.py b/tests/cmd/subcommands/test_delete_all.py
index 15fc23dd..39264994 100644
--- a/tests/cmd/subcommands/test_delete_all.py
+++ b/tests/cmd/subcommands/test_delete_all.py
@@ -17,8 +17,6 @@
# of actions by the JJB library, usually through interaction with the
# python-jenkins library.
-import six
-
from tests.base import mock
from tests.cmd.test_cmd import CmdTestsBase
@@ -27,8 +25,6 @@ from tests.cmd.test_cmd import CmdTestsBase
mock.MagicMock)
class DeleteAllTests(CmdTestsBase):
- input_module = "jenkins_jobs.utils" if six.PY2 else "builtins"
-
@mock.patch('jenkins_jobs.cli.subcommand.update.'
'JenkinsManager.delete_all_jobs')
def test_delete_all_accept(self, delete_job_mock):
@@ -37,7 +33,7 @@ class DeleteAllTests(CmdTestsBase):
"""
args = ['--conf', self.default_config_file, 'delete-all']
- with mock.patch('%s.input' % self.input_module, return_value="y"):
+ with mock.patch('jenkins_jobs.utils.input', return_value="y"):
self.execute_jenkins_jobs_with_args(args)
@mock.patch('jenkins_jobs.cli.subcommand.update.'
@@ -48,6 +44,6 @@ class DeleteAllTests(CmdTestsBase):
"""
args = ['--conf', self.default_config_file, 'delete-all']
- with mock.patch('%s.input' % self.input_module, return_value="n"):
+ with mock.patch('jenkins_jobs.utils.input', return_value="n"):
self.assertRaises(SystemExit,
self.execute_jenkins_jobs_with_args, args)