Skip to content

[PLT-1205] Fix integration tests #1698

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 1 commit into from
Jun 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions libs/labelbox/tests/integration/schema/test_user_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ def test_update_user_group(user_group):

def test_get_user_groups(user_group, client):
# Get all user groups
user_groups_old = UserGroup.get_user_groups(client)
user_groups_old = list(UserGroup.get_user_groups(client))

# manual delete for iterators
group_name = data.name()
user_group = UserGroup(client)
user_group.name = group_name
user_group.create()

user_groups_new = UserGroup.get_user_groups(client)
user_groups_new = list(UserGroup.get_user_groups(client))

# Verify that at least one user group is returned
assert len(user_groups_new) > 0
Expand All @@ -76,13 +76,23 @@ def test_update_user_group(user_group, client, project_pack):
projects = project_pack

# Add the user to the group
user_group.users.add(users[0])
user_group.projects.add(projects[0])
user = users[0]
user = UserGroupUser(
id=user.uid,
email=user.email
)
project = projects[0]
project = UserGroupProject(
id=project.uid,
name=project.name
)
user_group.users.add(user)
user_group.projects.add(project)
user_group.update()

# Verify that the user is added to the group
assert users[0] in user_group.users
assert projects[0] in user_group.projects
assert user in user_group.users
assert project in user_group.projects


if __name__ == "__main__":
Expand Down
Loading