From 24930b4f5296046cfde962a6a567be29ae52561e Mon Sep 17 00:00:00 2001 From: Olivier Tilloy Date: Thu, 9 May 2024 17:13:01 +0200 Subject: [PATCH] Staging extension: fix the return value of set_status_report() (fixes #158) --- osctiny/extensions/staging.py | 2 +- osctiny/tests/test_staging.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/osctiny/extensions/staging.py b/osctiny/extensions/staging.py index a0a26e2..599062a 100644 --- a/osctiny/extensions/staging.py +++ b/osctiny/extensions/staging.py @@ -378,7 +378,7 @@ def set_status_report(self, project: str, repo: str, build_id: str, report: Chec ) parsed = self.osc.get_objectified_xml(response) - if response.status_code == 200 and parsed.get("code") == "ok": + if response.status_code == 200: return True return False diff --git a/osctiny/tests/test_staging.py b/osctiny/tests/test_staging.py index 415ffe7..dc7aa40 100644 --- a/osctiny/tests/test_staging.py +++ b/osctiny/tests/test_staging.py @@ -1,5 +1,6 @@ import re +from lxml import etree import responses from osctiny.models.staging import ExcludedRequest, CheckState, CheckReport @@ -234,7 +235,7 @@ def callback(request): self.assertEqual(elem.short_description.text, report.short_description) self.assertEqual(elem.url.text, report.url) - return 200, {}, "" + return 200, {}, etree.tostring(report.asxml()).decode() responses.add_callback( method="POST",