Skip to content

Commit c6dafca

Browse files
committed
add test also for v1
- +v1 is raising error just from push start (push_project_async), because there are not chunks caches
1 parent 29292da commit c6dafca

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

mergin/test/test_client.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3174,13 +3174,25 @@ def test_client_project_sync_retry(mc):
31743174
mc.sync_project(project_dir)
31753175
assert mock_push_project_finalize.call_count == 1
31763176

3177-
with patch("mergin.client.push_project_finalize") as mock_push_project_finalize, patch(
3177+
with patch("mergin.client.push_project_async") as mock_push_project_async, patch(
31783178
"mergin.client.PUSH_ATTEMPTS", 2
31793179
):
3180-
mock_push_project_finalize.side_effect = ClientError(
3180+
mock_push_project_async.side_effect = ClientError(
31813181
detail="",
31823182
server_code=ErrorCode.AnotherUploadRunning.value,
31833183
)
31843184
with pytest.raises(ClientError):
31853185
mc.sync_project(project_dir)
3186-
assert mock_push_project_finalize.call_count == 2
3186+
assert mock_push_project_async.call_count == 2
3187+
3188+
# for v1 endpoints we are rising retry just from push start
3189+
with patch("mergin.client.push_project_async") as mock_push_project_async, patch(
3190+
"mergin.client.PUSH_ATTEMPTS", 2
3191+
):
3192+
mock_push_project_async.side_effect = ClientError(
3193+
detail="Another process is running. Please try later.",
3194+
http_error=400,
3195+
)
3196+
with pytest.raises(ClientError):
3197+
mc.sync_project(project_dir)
3198+
assert mock_push_project_async.call_count == 2

0 commit comments

Comments
 (0)