chore: remove usage of getattr()#1375
chore: remove usage of getattr()#1375nejch merged 1 commit intopython-gitlab:masterfrom JohnVillalovos:jlvillal/update_uses_post
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1375 +/- ##
=======================================
Coverage 79.95% 79.96%
=======================================
Files 73 73
Lines 4016 4017 +1
=======================================
+ Hits 3211 3212 +1
Misses 805 805
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Remove usage of getattr(self, "_update_uses_post", False) Instead add it to class and set default value to False. Add a tests that shows it is set to True for the ProjectMergeRequestApprovalManager and ProjectApprovalManager classes.
|
@nejch If you have time to review, it would be appreciated. |
nejch
left a comment
There was a problem hiding this comment.
Thanks again! :) Left a side note for a follow-up if we get to it.
| def test_project_approval_manager_update_uses_post(project, resp_snippet): | ||
| """Ensure the | ||
| gitlab.v4.objects.merge_request_approvals.ProjectApprovalManager object has | ||
| _update_uses_post set to True""" |
There was a problem hiding this comment.
I was originally thinking this would be more appropriate in a separate test/fake manager, to test just this specific aspect of it, e.g. in test_object_mixin_attributes.py. But since it's only used here I think it's ok, maybe for a follow-up PR :)
There was a problem hiding this comment.
I can do that, though I'm not quite sure what you want me to do 😕
Do you want a test that shows that update_uses_post exists and is False in test_object_mixin_attributes.py ?
Uh oh!
There was an error while loading. Please reload this page.