Skip to content

Commit 20d565d

Browse files
committed
fixes test
1 parent 1f8724d commit 20d565d

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

services/web/server/src/simcore_service_webserver/api/v0/openapi.yaml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11001,10 +11001,13 @@ components:
1100111001
title: Id
1100211002
description: the user's id
1100311003
userName:
11004-
type: string
11005-
maxLength: 100
11006-
minLength: 1
11004+
anyOf:
11005+
- type: string
11006+
maxLength: 100
11007+
minLength: 1
11008+
- type: 'null'
1100711009
title: Username
11010+
description: None if private
1100811011
gid:
1100911012
anyOf:
1101011013
- type: integer
@@ -11019,19 +11022,19 @@ components:
1101911022
format: email
1102011023
- type: 'null'
1102111024
title: Login
11022-
description: the user's email, if privacy settings allows
11025+
description: the user's email or None if private
1102311026
first_name:
1102411027
anyOf:
1102511028
- type: string
1102611029
- type: 'null'
1102711030
title: First Name
11028-
description: If privacy settings allows
11031+
description: None if private
1102911032
last_name:
1103011033
anyOf:
1103111034
- type: string
1103211035
- type: 'null'
1103311036
title: Last Name
11034-
description: If privacy settings allows
11037+
description: None if private
1103511038
gravatar_id:
1103611039
anyOf:
1103711040
- type: string
@@ -11046,8 +11049,6 @@ components:
1104611049
description: If group is standard, these are these are the access rights
1104711050
of the user to it.None if primary group.
1104811051
type: object
11049-
required:
11050-
- userName
1105111052
title: GroupUserGet
1105211053
example:
1105311054
accessRights:

services/web/server/tests/unit/with_dbs/03/test_users.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ async def test_get_user_by_group_id(
271271
assert private_user["id"] != logged_user["id"]
272272
assert public_user["id"] != logged_user["id"]
273273

274-
# GET user by primary GID
274+
# GET public_user by its primary gid
275275
url = client.app.router["get_all_group_users"].url_for(
276276
gid=f"{public_user['primary_gid']}"
277277
)
@@ -285,6 +285,7 @@ async def test_get_user_by_group_id(
285285
assert users[0].first_name == public_user.get("first_name")
286286
assert users[0].last_name == public_user.get("last_name")
287287

288+
# GET private_user by its primary gid
288289
url = client.app.router["get_all_group_users"].url_for(
289290
gid=f"{private_user['primary_gid']}"
290291
)
@@ -294,9 +295,9 @@ async def test_get_user_by_group_id(
294295
users = TypeAdapter(list[GroupUserGet]).validate_python(data)
295296
assert len(users) == 1
296297
assert users[0].id == private_user["id"]
297-
assert users[0].user_name == private_user["name"]
298-
assert users[0].first_name is None
299-
assert users[0].last_name is None
298+
assert users[0].user_name is None, "It's private"
299+
assert users[0].first_name is None, "It's private"
300+
assert users[0].last_name is None, "It's private"
300301

301302

302303
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)