From 1246aba3e5c4dbf1e050d710ea1e73f5e33618ae 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 | 3 +-- osctiny/tests/test_staging.py | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/osctiny/extensions/staging.py b/osctiny/extensions/staging.py index a0a26e2..a5aeb5d 100644 --- a/osctiny/extensions/staging.py +++ b/osctiny/extensions/staging.py @@ -377,8 +377,7 @@ def set_status_report(self, project: str, repo: str, build_id: str, report: Chec data=report.asxml() ) - 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",