Previously, build_possible_rss_url was using string splitting to append parts onto the URL. It's much simpler to use urllib.parse.urlparse and replace URL components that way.
There was also another implementation of the same thing in rssdiscoveryengine_app.rssfinder.find_rss_url, which now uses the helper function.
As I wanted to validate that this did not change any behaviour, this PR also adds a tests directory and adds pytest to the requirements as a starting point for adding unit tests.
Previously,
build_possible_rss_url
was using string splitting to append parts onto the URL. It's much simpler to useurllib.parse.urlparse
and replace URL components that way.There was also another implementation of the same thing in
rssdiscoveryengine_app.rssfinder.find_rss_url
, which now uses the helper function.As I wanted to validate that this did not change any behaviour, this PR also adds a
tests
directory and addspytest
to the requirements as a starting point for adding unit tests.Driveby fix: rearrange some imports.