@@ -102,8 +102,9 @@ class TestUserGroup:
102
102
def setup_method (self ):
103
103
# Reset the global roles cache before each test
104
104
import labelbox .schema .role as role_module
105
+
105
106
role_module ._ROLES = None
106
-
107
+
107
108
self .client = MagicMock (Client )
108
109
self .client .get_roles .return_value = {
109
110
"LABELER" : Role (self .client , {"id" : "role_id" , "name" : "LABELER" }),
@@ -199,7 +200,7 @@ def test_get(self):
199
200
],
200
201
},
201
202
}
202
- }
203
+ },
203
204
]
204
205
group = UserGroup (self .client )
205
206
assert group .id == ""
@@ -318,9 +319,7 @@ def test_update_without_members_should_work(self, group_project):
318
319
}
319
320
},
320
321
# Mock get_roles query response (even though no members, _get_members_set is still called)
321
- {
322
- "roles" : []
323
- },
322
+ {"roles" : []},
324
323
# Mock get query response
325
324
{
326
325
"userGroupV2" : {
@@ -423,7 +422,7 @@ def test_user_groups(self):
423
422
},
424
423
],
425
424
}
426
- }
425
+ },
427
426
]
428
427
user_groups = list (UserGroup .get_user_groups (self .client ))
429
428
assert len (user_groups ) == 2
@@ -541,9 +540,7 @@ def test_create_without_members_should_work(self, group_project):
541
540
}
542
541
},
543
542
# Mock get_roles query response (even though no members, _get_members_set is still called)
544
- {
545
- "roles" : []
546
- },
543
+ {"roles" : []},
547
544
# Mock get query response
548
545
{
549
546
"userGroupV2" : {
@@ -632,9 +629,7 @@ def test_create_mutation():
632
629
}
633
630
},
634
631
# Second call: get_roles query
635
- {
636
- "roles" : []
637
- },
632
+ {"roles" : []},
638
633
# Third call: get query
639
634
{
640
635
"userGroupV2" : {
@@ -694,9 +689,7 @@ def test_update_mutation():
694
689
}
695
690
},
696
691
# Second call: get_roles query
697
- {
698
- "roles" : []
699
- },
692
+ {"roles" : []},
700
693
# Third call: get query
701
694
{
702
695
"userGroupV2" : {
0 commit comments