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
pywikibot-commits@lists.wikimedia.org