Skip to content

Commit 1ec3f72

Browse files
committed
chore: add delete by id test
Signed-off-by: Tim Knight <tim.knight1@engineering.digital.dwp.gov.uk>
1 parent 7270b8e commit 1ec3f72

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

tests/functional/api/test_project_job_token_scope.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,24 @@ def test_projects_job_token_scope_groups_allowlist_contains_added_group_name(
7070
assert any(allowed.name == group_name for allowed in scope.groups_allowlist.list())
7171

7272
group_to_add.delete()
73+
74+
75+
def test_remove_group_by_id_from_projects_job_token_scope_groups_allowlist(gl, project):
76+
scope = project.job_token_scope.get()
77+
78+
group_to_add = gl.groups.create(
79+
{"name": "delete_group", "path": "allowlisted-delete-test"}
80+
)
81+
82+
scope.groups_allowlist.create({"target_group_id": group_to_add.id})
83+
84+
scope.refresh()
85+
86+
scope.allowlist.delete(group_to_add.id)
87+
88+
scope.refresh()
89+
assert not any(
90+
allowed.id == group_to_add.id for allowed in scope.groups_allowlist.list()
91+
)
92+
93+
group_to_add.delete()

0 commit comments

Comments
 (0)