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

Env util helper get_path #73

Closed
wants to merge 4 commits into from
Closed

Env util helper get_path #73

wants to merge 4 commits into from

Conversation

beshrkayali
Copy link
Contributor

Based on a suggestion from @flaeppe, this adds a method to the environment parsing helper that allows parsing strings as a pathlib.Path.

@github-actions
Copy link

github-actions bot commented Nov 5, 2021

File Coverage Lines Branches Missing
All files 92% 97% 87%
bananas/__init__.py 79% 83% 75% 19-20
bananas/models.py 97% 100% 95%
bananas/url.py 96% 100% 93%
bananas/admin/extension.py 93% 100% 86%
bananas/admin/api/i18n.py 90% 80% 100% 9
bananas/admin/api/mixins.py 68% 74% 63% 70, 78-84, 94, 110, 117-128
bananas/admin/api/serializers.py 75% 100% 50%
bananas/admin/api/versioning.py 91% 100% 83%
bananas/admin/api/views.py 99% 98% 100% 134
bananas/admin/api/schemas/base.py 87% 75% 100% 3
bananas/admin/api/schemas/yasg.py 88% 95% 82% 77, 86, 125-126
bananas/drf/fencing.py 87% 94% 80% 91-97, 136
bananas/management/commands/syncpermissions.py 87% 95% 80% 32

Minimum allowed coverage is 85%

Generated by 🐒 cobertura-action against f6c24ab

Copy link
Contributor

@antonagestam antonagestam left a comment

Choose a reason for hiding this comment

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

Nice! See related plans to improve the environment getters: #47

src/bananas/environment.py Outdated Show resolved Hide resolved
@antonagestam
Copy link
Contributor

I just recalled that this is the only thing we have type tests for, which is nice to have because it verifies that the exposed typing is correct. Would you mind adding a case for Path as well? https://github.com/5monkeys/django-bananas/blob/master/tests/test_env.yaml

@antonagestam
Copy link
Contributor

We want to test that:

  • Non-Path default is a type error
  • Omitting a default returns Path | None
  • Passing a default returns Path

@beshrkayali beshrkayali closed this Mar 1, 2023
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