From 687d9f94ebdbb2ac90bf50e80e4397af693efbc8 Mon Sep 17 00:00:00 2001 From: Ilia Meerovich Date: Wed, 29 Apr 2015 10:20:32 +0300 Subject: [PATCH] Adding unittest to ownership property Change-Id: I800001c651ed7db7e0c865e8f859e2d80cbc42e2 --- jenkins_jobs/modules/properties.py | 9 ++------- tests/properties/fixtures/ownership.xml | 15 +++++++++++++++ tests/properties/fixtures/ownership.yaml | 6 ++++++ 3 files changed, 23 insertions(+), 7 deletions(-) create mode 100644 tests/properties/fixtures/ownership.xml create mode 100644 tests/properties/fixtures/ownership.yaml diff --git a/jenkins_jobs/modules/properties.py b/jenkins_jobs/modules/properties.py index d75f9146d..8abe10e29 100644 --- a/jenkins_jobs/modules/properties.py +++ b/jenkins_jobs/modules/properties.py @@ -72,14 +72,9 @@ def ownership(parser, xml_parent, data): :arg str owner: the owner of job :arg list co-owners: list of job co-owners - Example:: + Example: - properties: - - ownership: - owner: abraverm - co-owners: - - lbednar - - edolinin + .. literalinclude:: /../../tests/properties/fixtures/ownership.yaml """ ownership_plugin = \ XML.SubElement(xml_parent, diff --git a/tests/properties/fixtures/ownership.xml b/tests/properties/fixtures/ownership.xml new file mode 100644 index 000000000..a57dc3079 --- /dev/null +++ b/tests/properties/fixtures/ownership.xml @@ -0,0 +1,15 @@ + + + + + + true + foo + + bar + moo + + + + + diff --git a/tests/properties/fixtures/ownership.yaml b/tests/properties/fixtures/ownership.yaml new file mode 100644 index 000000000..c5a357f24 --- /dev/null +++ b/tests/properties/fixtures/ownership.yaml @@ -0,0 +1,6 @@ +properties: + - ownership: + owner: foo + co-owners: + - bar + - moo \ No newline at end of file