@@ -21,7 +21,7 @@ def user_group(client):
21
21
user_group .delete ()
22
22
23
23
24
- def test_existing_user_groups (user_group , client ):
24
+ def test_get_user_group (user_group , client ):
25
25
# Verify that the user group was created successfully
26
26
user_group_equal = UserGroup (client )
27
27
user_group_equal .id = user_group .id
@@ -31,7 +31,15 @@ def test_existing_user_groups(user_group, client):
31
31
assert user_group .color == user_group_equal .color
32
32
33
33
34
- def test_cannot_get_user_group_with_invalid_id (client ):
34
+ def test_throw_error_get_user_group_no_id (user_group , client ):
35
+ old_id = user_group .id
36
+ with pytest .raises (ValueError ):
37
+ user_group .id = ""
38
+ user_group .get ()
39
+ user_group .id = old_id
40
+
41
+
42
+ def test_throw_error_cannot_get_user_group_with_invalid_id (client ):
35
43
user_group = UserGroup (client = client , id = str (uuid4 ()))
36
44
with pytest .raises (ResourceNotFoundError ):
37
45
user_group .get ()
@@ -108,12 +116,20 @@ def test_update_user_group(user_group):
108
116
assert user_group .color == UserGroupColor .PURPLE
109
117
110
118
111
- def test_cannot_update_name_to_empty_string (user_group ):
112
- with pytest .raises (UnprocessableEntityError ):
119
+ def test_throw_error_cannot_update_name_to_empty_string (user_group ):
120
+ with pytest .raises (ValueError ):
113
121
user_group .name = ""
114
122
user_group .update ()
115
123
116
124
125
+ def test_throw_error_cannot_update_id_to_empty_string (user_group ):
126
+ old_id = user_group .id
127
+ with pytest .raises (ValueError ):
128
+ user_group .id = ""
129
+ user_group .update ()
130
+ user_group .id = old_id
131
+
132
+
117
133
def test_cannot_update_group_id (user_group ):
118
134
old_id = user_group .id
119
135
with pytest .raises (ResourceNotFoundError ):
@@ -160,7 +176,7 @@ def test_get_user_groups_with_creation_deletion(client):
160
176
161
177
162
178
# project_pack creates two projects
163
- def test_update_user_group (user_group , client , project_pack ):
179
+ def test_update_user_group_users_projects (user_group , client , project_pack ):
164
180
users = list (client .get_users ())
165
181
projects = project_pack
166
182
@@ -192,6 +208,14 @@ def test_throw_error_when_deleting_invalid_id_group(client):
192
208
user_group .delete ()
193
209
194
210
211
+ def test_throw_error_delete_user_group_no_id (user_group , client ):
212
+ old_id = user_group .id
213
+ with pytest .raises (ValueError ):
214
+ user_group .id = ""
215
+ user_group .delete ()
216
+ user_group .id = old_id
217
+
218
+
195
219
if __name__ == "__main__" :
196
220
import subprocess
197
221
subprocess .call (["pytest" , "-v" , __file__ ])
0 commit comments