Skip to content

Commit

Permalink
Staging extension: fix the return value of set_status_report() (fixes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
oSoMoN committed May 9, 2024
1 parent 684aebf commit 24930b4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion osctiny/extensions/staging.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 2 additions & 1 deletion osctiny/tests/test_staging.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import re

from lxml import etree
import responses

from osctiny.models.staging import ExcludedRequest, CheckState, CheckReport
Expand Down Expand Up @@ -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, {}, "<status code=\"ok\"/>"
return 200, {}, etree.tostring(report.asxml()).decode()

responses.add_callback(
method="POST",
Expand Down

0 comments on commit 24930b4

Please sign in to comment.