Skip to content

feat(groups): add a list_ldap_group_links to go along with the pre ex… #2371

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

Merged
merged 7 commits into from
Nov 16, 2022

Conversation

rayisbadat
Copy link
Contributor

feat(groups): add a list_ldap_group_links to go along with the pre existing add_ldap_group_link and delete_ldap_group_link

@codecov-commenter
Copy link

codecov-commenter commented Nov 9, 2022

Codecov Report

Merging #2371 (a4456be) into main (034cde3) will decrease coverage by 0.03%.
The diff coverage is 60.00%.

@@            Coverage Diff             @@
##             main    #2371      +/-   ##
==========================================
- Coverage   95.95%   95.91%   -0.04%     
==========================================
  Files          79       79              
  Lines        5286     5291       +5     
==========================================
+ Hits         5072     5075       +3     
- Misses        214      216       +2     
Flag Coverage Δ
api_func_v4 83.57% <60.00%> (-0.03%) ⬇️
cli_func_v4 82.42% <60.00%> (-0.03%) ⬇️
unit 87.75% <60.00%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
gitlab/v4/objects/groups.py 88.46% <60.00%> (-0.95%) ⬇️

@rayisbadat rayisbadat force-pushed the feat/list_ldap_group_sync branch from a4456be to 858dd8b Compare November 10, 2022 16:34
@JohnVillalovos JohnVillalovos self-requested a review November 10, 2022 20:31
Copy link

@lmilbaum lmilbaum left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

@lmilbaum lmilbaum left a comment

Choose a reason for hiding this comment

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

Could you please add a unit test?

@rayisbadat
Copy link
Contributor Author

@lmilbaum Could you please add a unit test?

I added a unit test and tox passed. But this my first time doing such a thing. So if its not right , I might need a little help on whats needed.

Copy link
Member

@nejch nejch left a comment

Choose a reason for hiding this comment

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

@lmilbaum Could you please add a unit test?

I added a unit test and tox passed. But this my first time doing such a thing. So if its not right , I might need a little help on whats needed.

@rayisbadat it's a great start! You've added a test fixture, which you can now use to also create a test case, for example def test_list_ldap_group_links(group, resp_list_ldap_group_links):.

It will look a bit like this existing test, but without the isinstance assert probably:

def test_list_group_projects(group, resp_list_group_projects):
projects = group.projects.list()
assert isinstance(projects[0], GroupProject)
assert projects[0].path == projects_content[0]["path"]

Just a small tip, we usually put all the fixtures (things decorated with @pytest.fixture) at the top of the module, and test cases (def test_*) after them.

@rayisbadat rayisbadat force-pushed the feat/list_ldap_group_sync branch from 7a81117 to 6194085 Compare November 16, 2022 16:31
@nejch
Copy link
Member

nejch commented Nov 16, 2022

@JohnVillalovos I think you wanted to have another look at this?

Copy link
Member

@JohnVillalovos JohnVillalovos left a comment

Choose a reason for hiding this comment

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

@nejch Looks good to me, though would like it to be squashed when it is merged in.

@nejch nejch merged commit ad7c8fa into python-gitlab:main Nov 16, 2022
@nejch
Copy link
Member

nejch commented Nov 16, 2022

Thanks everyone. I did a squash and merge @JohnVillalovos

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.

6 participants