Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Staging extension: fix the return value of set_status_report() (fixes #158) #159

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions osctiny/extensions/staging.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
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
Loading