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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Imgur edge case coverage #671

Merged
merged 2 commits into from
Sep 30, 2022
Merged

Conversation

OMEGARAZER
Copy link
Contributor

Covers edge case of additional arguments on extension.

Also removed duplicate or redundant tests.

Covers edge case of additional arguments on extension.

Also removed duplicate or redundant tests.
Copy link
Owner

@Serene-Arc Serene-Arc left a comment

Choose a reason for hiding this comment

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

Why have you removed working tests from here?

@@ -78,7 +78,7 @@ def _get_data(link: str) -> dict:

@staticmethod
def _validate_extension(extension_suffix: str) -> str:
extension_suffix = extension_suffix.strip('?1')
extension_suffix = re.sub(r'\?.*', '', extension_suffix)
Copy link
Owner

Choose a reason for hiding this comment

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

Please add tests that show why this is necessary e.g. a test that fails before this change and succeeds afterwards.

Copy link
Contributor Author

@OMEGARAZER OMEGARAZER Sep 28, 2022

Choose a reason for hiding this comment

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

Outside what I mentioned in my other comment this covers ?2, ?3 and any others that may happen in the future. I'll go back and dig out the one that triggered this to go with the ?1 example and work on a test with them.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've added test cases that should hopefully satisfy this case, Not sure if there's a better way to test it but they verify they work currently.

@OMEGARAZER
Copy link
Contributor Author

Duplicate aside, with the factory sending anything with the Imgur domain to its own downloader rather than checking the extension on the link before deciding to send to Imgur or Direct the tests don't really serve any purpose outside of padding test count.

One link there is related to the other changes but that test would take place separately and currently does not have a test. I will have to dig into pytest to figure out how to properly add one for that.

Add tests for links that have arguments added to the extension field in retrieved image_dict
@Serene-Arc Serene-Arc merged commit 3d0ac9e into Serene-Arc:development Sep 30, 2022
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.

2 participants