Skip to content

Commit 9586ea8

Browse files
continue fixing
1 parent c1db89a commit 9586ea8

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

services/web/server/tests/unit/with_dbs/02/test_project_lock.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from models_library.projects_access import Owner
1313
from models_library.projects_state import ProjectLocked, ProjectStatus
1414
from models_library.users import UserID
15-
from pydantic import parse_raw_as
15+
from pydantic import TypeAdapter
1616
from simcore_service_webserver.projects.exceptions import ProjectLockError
1717
from simcore_service_webserver.projects.lock import (
1818
PROJECT_REDIS_LOCK_KEY,
@@ -51,7 +51,7 @@ async def test_lock_project(
5151
PROJECT_REDIS_LOCK_KEY.format(project_uuid)
5252
)
5353
assert redis_value
54-
lock_value = parse_raw_as(ProjectLocked, redis_value)
54+
lock_value = TypeAdapter(ProjectLocked).validate_json(redis_value)
5555
assert lock_value == ProjectLocked(
5656
value=True,
5757
owner=Owner(user_id=user_id, **user_fullname),
@@ -137,7 +137,7 @@ async def test_is_project_locked(
137137
faker: Faker,
138138
):
139139
assert client.app
140-
assert await is_project_locked(client.app, project_uuid) == False
140+
assert await is_project_locked(client.app, project_uuid) is False
141141
user_name: FullNameDict = {
142142
"first_name": faker.first_name(),
143143
"last_name": faker.last_name(),
@@ -149,7 +149,7 @@ async def test_is_project_locked(
149149
user_id=user_id,
150150
user_fullname=user_name,
151151
):
152-
assert await is_project_locked(client.app, project_uuid) == True
152+
assert await is_project_locked(client.app, project_uuid) is True
153153

154154

155155
@pytest.mark.parametrize(
@@ -170,9 +170,9 @@ async def test_get_project_locked_state(
170170
):
171171
assert client.app
172172
# no lock
173-
assert await get_project_locked_state(client.app, project_uuid) == None
173+
assert await get_project_locked_state(client.app, project_uuid) is None
174174

175-
assert await is_project_locked(client.app, project_uuid) == False
175+
assert await is_project_locked(client.app, project_uuid) is False
176176
user_name: FullNameDict = {
177177
"first_name": faker.first_name(),
178178
"last_name": faker.last_name(),

0 commit comments

Comments
 (0)