summaryrefslogtreecommitdiffstats
path: root/tests/cmd
diff options
context:
space:
mode:
authorThanh Ha <thanh.ha@linuxfoundation.org>2016-09-14 16:44:50 -0400
committerThanh Ha <thanh.ha@linuxfoundation.org>2016-10-14 09:14:21 -0400
commit1deb3aff4c1ff57b92d967c67411b316ef5b8952 (patch)
tree5cca52372cf16b9004ebababca0001f08030f61a /tests/cmd
parenta65c799a9e89641fc859d4f4716732247fc969c6 (diff)
downloadpython-jenkins-job-builder-1deb3aff4c1ff57b92d967c67411b316ef5b8952.tar.gz
python-jenkins-job-builder-1deb3aff4c1ff57b92d967c67411b316ef5b8952.tar.xz
python-jenkins-job-builder-1deb3aff4c1ff57b92d967c67411b316ef5b8952.zip
Add view management functionality
- Adds the ability for JJB to work with views - Views can be created, updated, and deleted. - New modules for List view and Build Pipeline view are added - New tests for testing the deletion of views Example View configuration: - view: name: MyView view-type: list Change-Id: Idb29a4407bcc14593e10a4d951036cb04e8e6c27 Co-Authored-By: Brandon Leonard <brandon.leonard@rackspace.com> Co-Authored-By: Joao Vale <jpvale@gmail.com> Co-Authored-By: Lucas Dutra Nunes <ldnunes@ossystems.com.br> Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
Diffstat (limited to 'tests/cmd')
-rw-r--r--tests/cmd/subcommands/test_delete.py8
-rw-r--r--tests/cmd/test_config.py2
2 files changed, 8 insertions, 2 deletions
diff --git a/tests/cmd/subcommands/test_delete.py b/tests/cmd/subcommands/test_delete.py
index 13b60927..4e577fd6 100644
--- a/tests/cmd/subcommands/test_delete.py
+++ b/tests/cmd/subcommands/test_delete.py
@@ -30,7 +30,9 @@ class DeleteTests(CmdTestsBase):
@mock.patch('jenkins_jobs.cli.subcommand.update.'
'JenkinsManager.delete_jobs')
- def test_delete_single_job(self, delete_job_mock):
+ @mock.patch('jenkins_jobs.cli.subcommand.update.'
+ 'JenkinsManager.delete_views')
+ def test_delete_single_job(self, delete_job_mock, delete_view_mock):
"""
Test handling the deletion of a single Jenkins job.
"""
@@ -40,7 +42,9 @@ class DeleteTests(CmdTestsBase):
@mock.patch('jenkins_jobs.cli.subcommand.update.'
'JenkinsManager.delete_jobs')
- def test_delete_multiple_jobs(self, delete_job_mock):
+ @mock.patch('jenkins_jobs.cli.subcommand.update.'
+ 'JenkinsManager.delete_views')
+ def test_delete_multiple_jobs(self, delete_job_mock, delete_view_mock):
"""
Test handling the deletion of multiple Jenkins jobs.
"""
diff --git a/tests/cmd/test_config.py b/tests/cmd/test_config.py
index 5236cdd4..de8257f4 100644
--- a/tests/cmd/test_config.py
+++ b/tests/cmd/test_config.py
@@ -123,6 +123,7 @@ class TestConfigs(CmdTestsBase):
args = ['--conf', self.default_config_file, 'update', path]
jenkins_mock.return_value.update_jobs.return_value = ([], 0)
+ jenkins_mock.return_value.update_views.return_value = ([], 0)
self.execute_jenkins_jobs_with_args(args)
# validate that the JJBConfig used to initialize builder.Jenkins
@@ -146,6 +147,7 @@ class TestConfigs(CmdTestsBase):
args = ['--conf', config_file, 'update', path]
jenkins_mock.return_value.update_jobs.return_value = ([], 0)
+ jenkins_mock.return_value.update_views.return_value = ([], 0)
self.execute_jenkins_jobs_with_args(args)
# validate that the JJBConfig used to initialize builder.Jenkins