Add sorting to querystring parameters for consistent tests.

Review Request #11662 — Created June 19, 2021 and submitted — Latest diff uploaded

Information

RBTools
master

Reviewers

Python 2.x and 3.x iterate dicts in different orders, which has
implications for assembling query strings. We have several tests which
spy on urlopen and return fake payloads, which were failing when run
on Python 3.

This change adds sorting to the querystring parameters before we
assemble them into a URL, and fixes up the test URLs to use those.

Ran unit tests on Python 2.7 and 3.9.

Diff Revision 1

This is not the most recent revision of the diff. The latest diff is revision 2. See what's changed.

orig
1
2

Commits

First Last Summary ID Author
Add sorting to querystring parameters for consistent tests.
Python 2.x and 3.x iterate dicts in different orders, which has implications for assembling query strings. We have several tests which spy on `urlopen` and return fake payloads, which were failing when run on Python 3. This change adds sorting to the querystring parameters before we assemble them into a URL, and fixes up the test URLs to use those. Testing Done: Ran unit tests or Python 2.7 and 3.9.
b49e7c88208b29f7cb3ea3f84facdd97c2693ed4 David Trowbridge
rbtools/api/request.py
rbtools/clients/tests/test_svn.py
rbtools/utils/tests/test_repository.py
Loading...