Skip to content

Conversation

@mielvds
Copy link
Collaborator

@mielvds mielvds commented Nov 26, 2025

Please review and merge #207 first!

This PR

  • moves remove_base(base, iri) to iri_resolver.py and renames it to unresolve(iri, base) (in correspondence with resolve())
  • refactor function to use standard lib urlparse and urlunparse
  • migrate references to remove_base((base, iri))
  • add unittests for unresolve(iri, base) in tests/test_iri_parser.py

@mielvds mielvds changed the title Move remove_base to unresolve function in iri_resolver Move and refactor remove_base to unresolve function in iri_resolver Nov 26, 2025
@mielvds mielvds force-pushed the split-and-test-iri-resolving branch from 65201a2 to fbe2bcf Compare December 4, 2025 13:42
@mielvds mielvds marked this pull request as ready for review December 4, 2025 13:47
Copy link
Member

@davidlehn davidlehn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a changelog entry. Could this be a breaking change?

assert resolve('?y','http://a/bb/ccc/./d;p?q') == 'http://a/bb/ccc/./d;p?y'

# ---------- Tests for unresolve() ----------
class TestUnresolve:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should class-based or function-based pytest testcases be chosen as uniform practice for this project?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally prefer class-based, but I'm fine with both. The only reason why the specs are function-based, is because I couldn't figure out how to make it work otherwise :) What do you think?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I must confess I never saw pytest class based tests in prod code. Everyone just writes functions after unittest ceased to be de facto standard. But that's just my anecdotal evidence.

@mielvds mielvds force-pushed the split-and-test-iri-resolving branch 2 times, most recently from 66827a9 to 1c521e4 Compare December 5, 2025 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants