Skip to content

[SDK-0] Disabling test #1971

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 3 commits into from
May 1, 2025
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
23 changes: 0 additions & 23 deletions libs/labelbox/tests/integration/test_api_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,26 +227,3 @@ def test_create_api_key_invalid_time_unit(client):
time_unit="days", # String instead of TimeUnit enum
)
assert "valid TimeUnit" in str(excinfo.value)


@pytest.mark.skipif(
condition=os.environ["LABELBOX_TEST_ENVIRON"] == "prod",
reason="Accounts with admin permission can create API keys",
)
def test_create_api_key_insufficient_permissions(client):
"""Test that creating an API key fails when the user has insufficient permissions."""
user_email = client.get_user().email

if client.get_user().org_role().name != "Admin":
# Attempt to create another API key using the limited permissions client
# This should fail due to insufficient permissions
with pytest.raises(LabelboxError) as excinfo:
client.create_api_key(
name=f"Test Key {uuid.uuid4()}",
user=user_email,
role="Admin",
validity=5,
time_unit=TimeUnit.MINUTE,
)

assert "192" in str(excinfo.value)
Loading