From ab67e6e630ec4fee3b446076dcf8d3f56e2233df Mon Sep 17 00:00:00 2001 From: Mihhail Matisinets Date: Wed, 16 Apr 2025 11:53:03 +0300 Subject: [PATCH 1/2] [SDK-0] Disabling test Signed-off-by: Mihhail Matisinets --- libs/labelbox/tests/integration/test_api_keys.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/libs/labelbox/tests/integration/test_api_keys.py b/libs/labelbox/tests/integration/test_api_keys.py index 531e10faa..816ea50c2 100644 --- a/libs/labelbox/tests/integration/test_api_keys.py +++ b/libs/labelbox/tests/integration/test_api_keys.py @@ -228,11 +228,9 @@ def test_create_api_key_invalid_time_unit(client): ) assert "valid TimeUnit" in str(excinfo.value) - -@pytest.mark.skipif( - condition=os.environ["LABELBOX_TEST_ENVIRON"] == "prod", - reason="Accounts with sdmin permission can create API keys", -) +# Not removing test completely as perhaps the original author on the test could elaborate more +# Disabling for the CI +@pytest.mark.skip(reason="Test does not make sense as there is no client with restricted permissions") 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 From 49854013aa237abb7139fa34cb33d4e9bf5a9103 Mon Sep 17 00:00:00 2001 From: Mihhail Matisinets Date: Wed, 30 Apr 2025 09:32:11 +0300 Subject: [PATCH 2/2] removed test Signed-off-by: Mihhail Matisinets --- .../tests/integration/test_api_keys.py | 21 ------------------- 1 file changed, 21 deletions(-) diff --git a/libs/labelbox/tests/integration/test_api_keys.py b/libs/labelbox/tests/integration/test_api_keys.py index 816ea50c2..d1e35ca82 100644 --- a/libs/labelbox/tests/integration/test_api_keys.py +++ b/libs/labelbox/tests/integration/test_api_keys.py @@ -228,24 +228,3 @@ def test_create_api_key_invalid_time_unit(client): ) assert "valid TimeUnit" in str(excinfo.value) -# Not removing test completely as perhaps the original author on the test could elaborate more -# Disabling for the CI -@pytest.mark.skip(reason="Test does not make sense as there is no client with restricted permissions") -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 - - assert 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)