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

Refactor is_static to perform more accurate check #165

Closed
wants to merge 1 commit into from
Closed

Refactor is_static to perform more accurate check #165

wants to merge 1 commit into from

Conversation

alex-way
Copy link

@alex-way alex-way commented Nov 9, 2021

Fixes #164 where the static paths are misinterpreting files such as readme.md as a staticpath (['readme/']) as a static file, when they aren't.

@alex-way
Copy link
Author

alex-way commented Nov 9, 2021

I need to add tests but I'm really not sure how to approach it (What to mock mainly).

I think adding the following additional tests for the is_static method should be sufficient?

  • Test a path isn't identified as a staticfile when a staticfile directory has the same name
  • Test a path is identified as a staticfile, when it's parent directory is in the staticfiles parameter
  • Test a path is identified as a staticfile, when the relative path is specified in the staticfiles parameter

@NickCrews
Copy link
Collaborator

Hey @alex-way, thanks for submitting this. Indeed that does look like it's broken. I will note that according to the docs using staticpaths is officially deprecated, although so many people use it that it's basically a feature. I'll try to get to this issue soon. I'm not sure if I want to keep supporting staticpaths or not at this point. We do need test cases if so. Thanks for your patience!

This pull request was closed.
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.

staticpaths incorrectly identifies files
2 participants