Skip to content

Commit 81a0c5c

Browse files
committed
change from locked to shareState
1 parent 9a1a53e commit 81a0c5c

File tree

4 files changed

+12
-29
lines changed

4 files changed

+12
-29
lines changed

packages/pytest-simcore/src/pytest_simcore/helpers/playwright.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,8 @@ def __call__(self, message: str) -> bool:
274274
decoded_message = decode_socketio_42_message(message)
275275
if (
276276
(decoded_message.name == _OSparcMessages.PROJECT_STATE_UPDATED.value)
277-
and (decoded_message.obj["data"]["locked"]["status"] == "CLOSED")
278-
and (decoded_message.obj["data"]["locked"]["value"] is False)
277+
and (decoded_message.obj["data"]["shareState"]["status"] == "CLOSED")
278+
and (decoded_message.obj["data"]["shareState"]["locked"] is False)
279279
):
280280
self.logger.info("project successfully closed")
281281
return True

packages/pytest-simcore/src/pytest_simcore/simcore_webserver_projects_rest_api.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -157,14 +157,10 @@ def request_desc(self) -> str:
157157
"quality": {},
158158
"tags": [],
159159
"state": {
160-
"locked": {
161-
"value": True,
162-
"owner": {
163-
"user_id": 1,
164-
"first_name": "crespo",
165-
"last_name": "",
166-
},
160+
"shareState": {
167161
"status": "OPENED",
162+
"locked": True,
163+
"currentUserGroupids": [1],
168164
},
169165
"state": {"value": "NOT_STARTED"},
170166
},

services/api-server/tests/unit/api_functions/test_api_routers_functions.py

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ async def test_list_functions(
156156
mock_registered_project_function: RegisteredProjectFunction,
157157
auth: httpx.BasicAuth,
158158
) -> None:
159-
160159
mock_handler_in_functions_rpc_interface(
161160
"list_functions",
162161
(
@@ -180,7 +179,6 @@ async def test_update_function_title(
180179
mock_registered_project_function: RegisteredProjectFunction,
181180
auth: httpx.BasicAuth,
182181
) -> None:
183-
184182
mock_handler_in_functions_rpc_interface(
185183
"update_function_title",
186184
RegisteredProjectFunction(
@@ -237,7 +235,6 @@ async def test_get_function_input_schema(
237235
mock_registered_project_function: RegisteredProjectFunction,
238236
auth: httpx.BasicAuth,
239237
) -> None:
240-
241238
mock_handler_in_functions_rpc_interface(
242239
"get_function", mock_registered_project_function
243240
)
@@ -261,7 +258,6 @@ async def test_get_function_output_schema(
261258
mock_registered_project_function: RegisteredProjectFunction,
262259
auth: httpx.BasicAuth,
263260
) -> None:
264-
265261
mock_handler_in_functions_rpc_interface(
266262
"get_function", mock_registered_project_function
267263
)
@@ -285,7 +281,6 @@ async def test_validate_function_inputs(
285281
mock_registered_project_function: RegisteredProjectFunction,
286282
auth: httpx.BasicAuth,
287283
) -> None:
288-
289284
mock_handler_in_functions_rpc_interface(
290285
"get_function", mock_registered_project_function
291286
)
@@ -349,7 +344,6 @@ async def test_get_function_job(
349344
mock_registered_project_function_job: RegisteredProjectFunctionJob,
350345
auth: httpx.BasicAuth,
351346
) -> None:
352-
353347
mock_handler_in_functions_rpc_interface(
354348
"get_function_job", mock_registered_project_function_job
355349
)
@@ -372,7 +366,6 @@ async def test_list_function_jobs(
372366
mock_registered_project_function_job: RegisteredProjectFunctionJob,
373367
auth: httpx.BasicAuth,
374368
) -> None:
375-
376369
mock_handler_in_functions_rpc_interface(
377370
"list_function_jobs",
378371
(
@@ -399,7 +392,6 @@ async def test_list_function_jobs_with_function_filter(
399392
mock_registered_project_function: RegisteredProjectFunction,
400393
auth: httpx.BasicAuth,
401394
) -> None:
402-
403395
mock_handler_in_functions_rpc_interface(
404396
"list_function_jobs",
405397
(
@@ -428,7 +420,6 @@ async def test_delete_function_job(
428420
mock_registered_project_function_job: RegisteredProjectFunctionJob,
429421
auth: httpx.BasicAuth,
430422
) -> None:
431-
432423
mock_handler_in_functions_rpc_interface("delete_function_job", None)
433424

434425
# Now, delete the function job
@@ -553,7 +544,6 @@ async def test_delete_function_job_collection(
553544
mock_registered_function_job_collection: RegisteredFunctionJobCollection,
554545
auth: httpx.BasicAuth,
555546
) -> None:
556-
557547
mock_handler_in_functions_rpc_interface("delete_function_job_collection", None)
558548

559549
# Now, delete the function job collection
@@ -572,7 +562,6 @@ async def test_get_function_job_collection_jobs(
572562
mock_registered_function_job_collection: RegisteredFunctionJobCollection,
573563
auth: httpx.BasicAuth,
574564
) -> None:
575-
576565
mock_handler_in_functions_rpc_interface(
577566
"get_function_job_collection", mock_registered_function_job_collection
578567
)
@@ -593,7 +582,6 @@ async def test_list_function_job_collections_with_function_filter(
593582
mock_registered_project_function: RegisteredProjectFunction,
594583
auth: httpx.BasicAuth,
595584
) -> None:
596-
597585
mock_handler_in_functions_rpc_interface(
598586
"list_function_job_collections",
599587
(
@@ -711,7 +699,6 @@ async def test_run_project_function_parent_info(
711699
expected_status_code: int,
712700
capture: str,
713701
) -> None:
714-
715702
def _default_side_effect(
716703
request: httpx.Request,
717704
path_params: dict[str, Any],
@@ -760,7 +747,7 @@ def _default_side_effect(
760747
),
761748
)
762749

763-
headers = dict()
750+
headers = {}
764751
if parent_project_uuid:
765752
headers[X_SIMCORE_PARENT_PROJECT_UUID] = parent_project_uuid
766753
if parent_node_uuid:
@@ -803,8 +790,7 @@ async def test_map_function_parent_info(
803790
expected_status_code: int,
804791
capture: str,
805792
) -> None:
806-
807-
side_effect_checks = dict()
793+
side_effect_checks = {}
808794

809795
def _default_side_effect(
810796
side_effect_checks: dict,
@@ -866,7 +852,7 @@ def _default_side_effect(
866852
),
867853
)
868854

869-
headers = dict()
855+
headers = {}
870856
if parent_project_uuid:
871857
headers[X_SIMCORE_PARENT_PROJECT_UUID] = parent_project_uuid
872858
if parent_node_uuid:
@@ -879,7 +865,7 @@ def _default_side_effect(
879865
headers=headers,
880866
)
881867
if expected_status_code == status.HTTP_200_OK:
882-
assert side_effect_checks["headers_checked"] == True
868+
assert side_effect_checks["headers_checked"] is True
883869
assert response.status_code == expected_status_code
884870

885871

services/api-server/tests/unit/test_services_solver_job_models_converters.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,10 @@ def test_create_job_from_project(faker: Faker):
182182
"quality": {},
183183
"tags": [],
184184
"state": {
185-
"locked": {
186-
"value": False,
185+
"shareState": {
187186
"status": "CLOSED",
187+
"locked": False,
188+
"currentUserGroupids": [],
188189
},
189190
"state": {"value": "SUCCESS"},
190191
},

0 commit comments

Comments
 (0)