Skip to content

Commit 373b46c

Browse files
committed
fix(groups): adding unit test for list_ldap_group_sync
1 parent 858dd8b commit 373b46c

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

tests/unit/objects/test_groups.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@
1212
from gitlab.v4.objects.projects import GroupProject, SharedProject
1313

1414
content = {"name": "name", "id": 1, "path": "path"}
15+
ldap_group_links_content = [
16+
{
17+
"cn": None,
18+
"group_access": 40,
19+
"provider": "ldapmain",
20+
"filter": "(memberOf=cn=some_group,ou=groups,ou=fake_ou,dc=sub_dc,dc=example,dc=tld)",
21+
}
22+
]
1523
projects_content = [
1624
{
1725
"id": 9,
@@ -261,6 +269,19 @@ def test_list_group_descendant_groups(group, resp_list_subgroups_descendant_grou
261269
assert descendant_groups[0].path == subgroup_descgroup_content[0]["path"]
262270

263271

272+
@pytest.fixture
273+
def resp_list_ldap_group_links(no_content):
274+
with responses.RequestsMock() as rsps:
275+
rsps.add(
276+
method=responses.GET,
277+
url="http://localhost/api/v4/groups/1/ldap_group_links",
278+
json=ldap_group_links_content,
279+
content_type="application/json",
280+
status=200,
281+
)
282+
yield rsps
283+
284+
264285
@pytest.mark.skip("GitLab API endpoint not implemented")
265286
def test_refresh_group_export_status(group, resp_export):
266287
export = group.exports.create()

0 commit comments

Comments
 (0)