| |
@@ -165,3 +165,24 @@
|
| |
con.process(msg)
|
| |
assert "Ostree (variant Silverblue, arch x86_64) failed, but going on anyway." in caplog.text
|
| |
assert "Ostree (variant Silverblue, arch ppc64le) failed, but going on anyway." in caplog.text
|
| |
+
|
| |
+ def test_adding_labels(mocker, caplog):
|
| |
+ "Test that we get the correct labels from the fedora-messaging message."
|
| |
+
|
| |
+ mocker.patch("compose_tracker.PagureService")
|
| |
+
|
| |
+ # set logs at DEBUG and capture this level
|
| |
+ caplog.set_level(logging.DEBUG)
|
| |
+ mocker.patch("compose_tracker.logger.level", logging.DEBUG)
|
| |
+
|
| |
+ req = mocker.patch("compose_tracker.requests.get", autospec=True)
|
| |
+ text_mock = mocker.MagicMock()
|
| |
+ text_mock.text.splitlines.return_value = EXAMPLE_PUNGI_LOG_INCOMPLETE.splitlines()
|
| |
+ req.return_value = text_mock
|
| |
+
|
| |
+ con = Consumer()
|
| |
+ msg = fedora_messaging.api.Message(
|
| |
+ topic="org.fedoraproject.prod.pungi.compose.status.change", body=EXAMPLE_MESSAGE_BODY,
|
| |
+ )
|
| |
+ con.process(msg)
|
| |
+ assert "Adding Labels ['Fedora', 'Rawhide', 'DOOMED']" in caplog.text
|
| |
The consumer get the release_name, release_version and status from
the fedora-messaging message and use these as labels when creating
the issue in pagure.
Signed-off-by: Clement Verna cverna@tutanota.com
Fixes #16.