diff --git a/jenkins_jobs/modules/publishers.py b/jenkins_jobs/modules/publishers.py index c16d1c919..c4e060d75 100644 --- a/jenkins_jobs/modules/publishers.py +++ b/jenkins_jobs/modules/publishers.py @@ -2736,25 +2736,9 @@ def ircbot(parser, xml_parent, data): * **only-configurations** (default) * **only-parent** - Example:: - - publishers: - - ircbot: - strategy: all - notify-start: false - notify-committers: false - notify-culprits: false - notify-upstream: false - notify-fixers: false - message-type: summary-scm - channels: - - name: '#jenkins-channel1' - password: secrete - notify-only: false - - name: '#jenkins-channel2' - notify-only: true - matrix-notifier: only-configurations + Example: + .. literalinclude:: /../../tests/publishers/fixtures/ircbot001.yaml """ top = XML.SubElement(xml_parent, 'hudson.plugins.ircbot.IrcPublisher') message_dict = {'summary-scm': 'DefaultBuildToChatNotifier', @@ -2801,7 +2785,7 @@ def ircbot(parser, xml_parent, data): matrix_dict = {'all': 'ALL', 'only-configurations': 'ONLY_CONFIGURATIONS', 'only-parent': 'ONLY_PARENT'} - matrix = data.get('matrix-notifier', 'only_configurations') + matrix = data.get('matrix-notifier', 'only-configurations') if matrix not in matrix_dict: raise JenkinsJobsException("matrix-notifier entered is not valid, " "must be one of: %s" % diff --git a/tests/publishers/fixtures/ircbot001.xml b/tests/publishers/fixtures/ircbot001.xml new file mode 100644 index 000000000..ccc6b0c6a --- /dev/null +++ b/tests/publishers/fixtures/ircbot001.xml @@ -0,0 +1,27 @@ + + + + + + ALL + + + #jenkins-channel1 + secrete + false + + + #jenkins-channel2 + + true + + + false + false + false + false + false + ONLY_CONFIGURATIONS + + + diff --git a/tests/publishers/fixtures/ircbot001.yaml b/tests/publishers/fixtures/ircbot001.yaml new file mode 100644 index 000000000..faf4d7247 --- /dev/null +++ b/tests/publishers/fixtures/ircbot001.yaml @@ -0,0 +1,16 @@ +publishers: + - ircbot: + strategy: all + notify-start: false + notify-committers: false + notify-culprits: false + notify-upstream: false + notify-fixers: false + message-type: summary-scm + channels: + - name: '#jenkins-channel1' + password: secrete + notify-only: false + - name: '#jenkins-channel2' + notify-only: true + matrix-notifier: only-configurations diff --git a/tests/publishers/fixtures/ircbot002.xml b/tests/publishers/fixtures/ircbot002.xml new file mode 100644 index 000000000..03662ae14 --- /dev/null +++ b/tests/publishers/fixtures/ircbot002.xml @@ -0,0 +1,22 @@ + + + + + + ALL + + + #jenkins-channel + + true + + + false + false + false + false + false + ONLY_CONFIGURATIONS + + + diff --git a/tests/publishers/fixtures/ircbot002.yaml b/tests/publishers/fixtures/ircbot002.yaml new file mode 100644 index 000000000..6d56a36a5 --- /dev/null +++ b/tests/publishers/fixtures/ircbot002.yaml @@ -0,0 +1,5 @@ +publishers: + - ircbot: + channels: + - name: '#jenkins-channel' + notify-only: true