diff options
author | Jan Zerebecki <jan.openstack@zerebecki.de> | 2019-10-28 15:22:17 +0100 |
---|---|---|
committer | Jan Zerebecki <jan.openstack@zerebecki.de> | 2019-10-28 23:37:27 +0100 |
commit | 35d4da29d38b1f6326dcbb7236e9658db5d81bbc (patch) | |
tree | a281c75b56bb4803df39f11f1efc3224047cf3de /tests | |
parent | 587740ec757e46bc971110582e2e9f3f134b26b3 (diff) | |
download | python-jenkins-job-builder-35d4da29d38b1f6326dcbb7236e9658db5d81bbc.tar.gz python-jenkins-job-builder-35d4da29d38b1f6326dcbb7236e9658db5d81bbc.tar.xz python-jenkins-job-builder-35d4da29d38b1f6326dcbb7236e9658db5d81bbc.zip |
Support sectioned views
Change-Id: Iaf352e8cc62644fb05afaae21630b9bec2cd30c0
Diffstat (limited to 'tests')
-rw-r--r-- | tests/base.py | 3 | ||||
-rw-r--r-- | tests/views/fixtures/view_sectioned.xml | 34 | ||||
-rw-r--r-- | tests/views/fixtures/view_sectioned.yaml | 14 | ||||
-rw-r--r-- | tests/views/test_views.py | 7 |
4 files changed, 58 insertions, 0 deletions
diff --git a/tests/base.py b/tests/base.py index f828c773..910133f4 100644 --- a/tests/base.py +++ b/tests/base.py @@ -49,6 +49,7 @@ from jenkins_jobs.modules import view_all from jenkins_jobs.modules import view_list from jenkins_jobs.modules import view_nested from jenkins_jobs.modules import view_pipeline +from jenkins_jobs.modules import view_sectioned from jenkins_jobs.parser import YamlParser from jenkins_jobs.registry import ModuleRegistry from jenkins_jobs.xml_config import XmlJob @@ -242,6 +243,8 @@ class BaseScenariosTestCase(testscenarios.TestWithScenarios, BaseTestCase): project = view_nested.Nested(registry) elif yaml_content["view-type"] == "pipeline": project = view_pipeline.Pipeline(registry) + elif yaml_content["view-type"] == "sectioned": + project = view_sectioned.Sectioned(registry) else: raise InvalidAttributeError("view-type", yaml_content["view-type"]) diff --git a/tests/views/fixtures/view_sectioned.xml b/tests/views/fixtures/view_sectioned.xml new file mode 100644 index 00000000..47ee86c5 --- /dev/null +++ b/tests/views/fixtures/view_sectioned.xml @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="utf-8"?> +<hudson.plugins.sectioned__view.SectionedView> + <name>SectionedViewTest</name> + <description/> + <filterExecutors>false</filterExecutors> + <filterQueue>false</filterQueue> + <properties class="hudson.model.View$PropertyList"/> + <sections> + <hudson.plugins.sectioned__view.ListViewSection> + <name>testName</name> + <jobNames> + <comparator class="hudson.util.CaseInsensitiveComparator"/> + <string>testJobName</string> + </jobNames> + <jobFilters/> + <width>HALF</width> + <alignment>LEFT</alignment> + <columns> + <hudson.views.JobColumn/> + </columns> + </hudson.plugins.sectioned__view.ListViewSection> + <hudson.plugins.sectioned__view.TextSection> + <jobNames> + <comparator class="hudson.util.CaseInsensitiveComparator"/> + </jobNames> + <jobFilters/> + <name/> + <width>FULL</width> + <alignment>CENTER</alignment> + <text>test text</text> + <style>INFO</style> + </hudson.plugins.sectioned__view.TextSection> + </sections> +</hudson.plugins.sectioned__view.SectionedView> diff --git a/tests/views/fixtures/view_sectioned.yaml b/tests/views/fixtures/view_sectioned.yaml new file mode 100644 index 00000000..aa4c7567 --- /dev/null +++ b/tests/views/fixtures/view_sectioned.yaml @@ -0,0 +1,14 @@ +name: SectionedViewTest +view-type: sectioned +sections: + - name: testName + job-name: + - testJobName + columns: + - job + view-type: list + width: HALF + alignment: LEFT + - text: test text + style: INFO + view-type: text diff --git a/tests/views/test_views.py b/tests/views/test_views.py index 62435590..fb506310 100644 --- a/tests/views/test_views.py +++ b/tests/views/test_views.py @@ -17,6 +17,7 @@ from jenkins_jobs.modules import view_all from jenkins_jobs.modules import view_list from jenkins_jobs.modules import view_nested from jenkins_jobs.modules import view_pipeline +from jenkins_jobs.modules import view_sectioned from tests import base @@ -42,3 +43,9 @@ class TestCaseModuleViewPipeline(base.BaseScenariosTestCase): fixtures_path = os.path.join(os.path.dirname(__file__), "fixtures") scenarios = base.get_scenarios(fixtures_path) klass = view_pipeline.Pipeline + + +class TestCaseModuleViewSectioned(base.BaseScenariosTestCase): + fixtures_path = os.path.join(os.path.dirname(__file__), "fixtures") + scenarios = base.get_scenarios(fixtures_path) + klass = view_sectioned.Sectioned |