File tree 1 file changed +11
-11
lines changed
libs/labelbox/tests/integration
1 file changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -237,17 +237,17 @@ def test_create_api_key_insufficient_permissions(client):
237
237
"""Test that creating an API key fails when the user has insufficient permissions."""
238
238
user_email = client .get_user ().email
239
239
240
- assert client .get_user ().org_role ().name == "Admin"
240
+ if client .get_user ().org_role ().name == "Admin" :
241
241
242
242
# Attempt to create another API key using the limited permissions client
243
243
# This should fail due to insufficient permissions
244
- with pytest .raises (LabelboxError ) as excinfo :
245
- client .create_api_key (
246
- name = f"Test Key { uuid .uuid4 ()} " ,
247
- user = user_email ,
248
- role = "Admin" ,
249
- validity = 5 ,
250
- time_unit = TimeUnit .MINUTE ,
251
- )
252
-
253
- assert "192" in str (excinfo .value )
244
+ with pytest .raises (LabelboxError ) as excinfo :
245
+ client .create_api_key (
246
+ name = f"Test Key { uuid .uuid4 ()} " ,
247
+ user = user_email ,
248
+ role = "Admin" ,
249
+ validity = 5 ,
250
+ time_unit = TimeUnit .MINUTE ,
251
+ )
252
+
253
+ assert "192" in str (excinfo .value )
You can’t perform that action at this time.
0 commit comments