-
Notifications
You must be signed in to change notification settings - Fork 13
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
feat: Increase coverage. #484
Conversation
Fixes unioslo#483 First pass: - Add pragma to exempt lines from coverage to .coveragerc - Add test for stringifying HostPolicyComponent-based objects (see unioslo#482) - Mock host_permissions/user_in_required_groups as its not supported by default. - Ensure that IsSuperOrAdminOrReadOnly is tested for unauthenticated users (test_permissions/test_get_at_different_privilege_levels) - Exclude exceptions from coverage that are impossible to reach without creating a broken API. - Test that IsSuperOrNetworkAdminMember returns 401 for unauthenticated users (test_networks/test_networks_get_401_unauthorized).
- Pragma out more unreachable code paths. - Some of these code paths should to be reworked to ensure that production doesn't rely on them. - Pragma out skipped tests. - Added tests for conflicting labels and IDNA errors. - Added tests for some internal and previous untested code.
The next steps is to test https://github.com/unioslo/mreg/blob/master/mreg/signals.py and https://github.com/unioslo/mreg/blob/master/mreg/mqsender.py. There is no need to take that work into this PR. Opening for review. |
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.
Some tiny adjustments needed. Mostly justifying pragmas.
- Test add_user_to_groups (limited scope) - Remove some overzealous pragmas. - Add comments for skipped tests.
- Code paths we should never reach aren't reached during tests...
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.
👍 💯
Eventually fixes #483
First pass: