jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/567216 )
Change subject: [tests] Remove X-Amzn-Trace-Id tracker before comparison
......................................................................
[tests] Remove X-Amzn-Trace-Id tracker before comparison
Bug: T243662
Change-Id: Ibfe647a9cfc5c8ccd1b31bf76d44a66952f9b008
---
M tests/http_tests.py
1 file changed, 14 insertions(+), 6 deletions(-)
Approvals:
Dvorapa: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/http_tests.py b/tests/http_tests.py
index 27f4d79..21f50b8 100644
--- a/tests/http_tests.py
+++ b/tests/http_tests.py
@@ -694,13 +694,21 @@
def test_fetch(self):
"""Test that using the data and body params produce same
results."""
- r_data = http.fetch(uri=self.get_httpbin_url('/post'),
method='POST',
- data={'fish&chips': 'delicious'})
- r_body = http.fetch(uri=self.get_httpbin_url('/post'),
method='POST',
- body={'fish&chips': 'delicious'})
+ r_data_request = http.fetch(uri=self.get_httpbin_url('/post'),
+ method='POST',
+ data={'fish&chips':
'delicious'})
+ r_body_request = http.fetch(uri=self.get_httpbin_url('/post'),
+ method='POST',
+ body={'fish&chips':
'delicious'})
- self.assertDictEqual(json.loads(r_data.text),
- json.loads(r_body.text))
+ r_data = json.loads(r_data_request.text)
+ r_body = json.loads(r_body_request.text)
+
+ # remove X-Amzn-Trace-Id if present (T243662)
+ r_data['headers'].pop('X-Amzn-Trace-Id', None)
+ r_body['headers'].pop('X-Amzn-Trace-Id', None)
+
+ self.assertDictEqual(r_data, r_body)
if __name__ == '__main__': # pragma: no cover
--
To view, visit
https://gerrit.wikimedia.org/r/567216
To unsubscribe, or for help writing mail filters, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ibfe647a9cfc5c8ccd1b31bf76d44a66952f9b008
Gerrit-Change-Number: 567216
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Dvorapa <dvorapa(a)seznam.cz>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot (75)