feat(api): add DeleteMixin, ListMixin to GroupServiceAccountManager and ObjectDeleteMixin to GroupServiceAccount
add DeleteMixin, ListMixin to GroupServiceAccountManager and ObjectDeleteMixin to GroupServiceAccount
Changes
Documentation and testing
Please consider whether this PR needs documentation and tests. This is not required, but highly appreciated:
- [ ] Documentation in the matching docs section
- [ ] Unit tests and/or functional tests
@nejch , Can you check if this is functionally complete? If it is, I'll start to add tests.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 96.53%. Comparing base (
bcef988) to head (b57fbf2).
Additional details and impacted files
@@ Coverage Diff @@
## main #2963 +/- ##
=======================================
Coverage 96.53% 96.53%
=======================================
Files 94 94
Lines 5997 5997
=======================================
Hits 5789 5789
Misses 208 208
| Flag | Coverage Δ | |
|---|---|---|
| api_func_v4 | 82.49% <100.00%> (-0.12%) |
:arrow_down: |
| cli_func_v4 | 83.47% <100.00%> (ø) |
|
| unit | 88.52% <100.00%> (ø) |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Files with missing lines | Coverage Δ | |
|---|---|---|
| gitlab/v4/objects/service_accounts.py | 100.00% <100.00%> (ø) |
Thanks for the contribution @ka28kumar I just got back to this.
Yes, this looks good! If you could add a few basic tests/asserts to the existing functional tests, this would be really appreciated! Thanks!
Will add. Thanks!
Did you still want to add a few tests here @ka28kumar? Could just be a simple extension of: https://github.com/python-gitlab/python-gitlab/blob/3739b5dd11bed66fb482cf6d2dc34382327a0265/tests/functional/api/test_groups.py#L315
E.g.:
def test_group_service_accounts(group):
service_account = group.service_accounts.create(
{"name": "gitlab-service-account", "username": "gitlab-service-account"}
)
assert service_account.name == "gitlab-service-account"
assert service_account.username == "gitlab-service-account"
service_accounts = group.service_accounts.list()
assert service_accounts[0] == service_account
service_account.delete()
Or something like that. Let me know otherwise we can also take over here!
I'm sorry I got occupied with some tasks. Feel free to take over.
Thanks @ka28kumar let's get this merged and I've opened a follow-up for the tests.