-
Notifications
You must be signed in to change notification settings - Fork 136
Separate and test URI resolving #207
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: migrate-to-pytest
Are you sure you want to change the base?
Conversation
24b1ce6 to
65201a2
Compare
65201a2 to
fbe2bcf
Compare
davidlehn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- In jsonld.js I think there was a similar move to a
url.jsfile. Someday I want to see if the jsURLapi can replace a lot of this. Not sure if there's a similar library for python or what considerations there are using such a thing. - I think at some point it may have been decided not to put too many URL related tests in the main test suite. There are some. Perhaps at some point later we could extract these tests out into something shareable between implementations.
I now see the next related PR has a move to a more standard library. |
|
Needs a changelog entry. Is this a breaking change? |
|
@davidlehn this ports https://github.com/rubensworks/relative-to-absolute-iri.js, so jsonld.js could also use that one (at least for resolving relative IRIs) There should be no breaking changes, just more robustness. That said, the API changed a little:
|
3713302 to
c221bfe
Compare
fbe2bcf to
66827a9
Compare
66827a9 to
1c521e4
Compare
This PR moves functionality from
context_resolver.pytoiri_resolver.pyso it can be maintained and tested separately.This includes:
resolve()function and adding unittestsremove_dot_segments()and adding unittestsThis work is inspired by https://github.com/rubensworks/relative-to-absolute-iri.js (which is used in https://github.com/rubensworks/jsonld-streaming-parser.js) and can be considered a JS to Python port. The unittests are also ported from that repo as they battle-test both functions.
This PR is work in progress and currently uses pytest for convenience (this might change later).