File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed
Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments