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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reorganise tests in 'test_url.py' #2981

Merged
merged 2 commits into from Dec 5, 2023
Merged

Conversation

tomchristie
Copy link
Member

@tomchristie tomchristie commented Dec 5, 2023

I would like to deal with #2883.

In order to tackle this comprehensively I'm suggesting we start by tidying up our existing URL test cases.
There are two parts to this:

  • Reorganise the existing tests in models/test_url.py - The current ordering of the tests isn't coherent.
  • Remove test_urlparse.py, moving test cases into models/test_url.py - All the test cases there are now properly against the public httpx.URL() interface, tackled previously as part of the Refactor test cases that import from private namespace.聽#2492.

This pull request deals with the first of these two bullet-points.
I'll follow up with the second part once this is in.

Here's the explanation of the proposed change (assuming I've got it correct 馃槄)...

  • Tests are re-ordered, these no removal, addition, or modifying of test cases.
  • Some docstrings have been added.
  • Some comments helping claify the structure have been added.

The ordering for the test cases here is...

  • General tests for httpx.URL.
  • General tests for httpx.QueryParams.
  • Tests for httpx.URL.join().
  • Tests for httpx.URL.copy_with().
  • Tests for httpx.URL.copy_<...>.params() methods.
  • Tests for IDNA hostname support.
  • Tests for IPv6 hostname support.

@tomchristie tomchristie added the refactor Issues and PRs related to code refactoring label Dec 5, 2023
@tomchristie tomchristie requested a review from a team December 5, 2023 13:08
@tomchristie tomchristie merged commit 724eced into master Dec 5, 2023
5 checks passed
@tomchristie tomchristie deleted the reorganise-test-url-tests branch December 5, 2023 13:24
@tomchristie
Copy link
Member Author

Thanks @Kludex, @michaeloliverx. 馃檹馃徏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Issues and PRs related to code refactoring
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants