@@ -364,3 +364,30 @@ def test_force_gpkg_update(mc):
364
364
f_remote = next ((f for f in project_info ['files' ] if f ['path' ] == f_updated ), None )
365
365
assert f_remote ['checksum' ] == updated_checksum
366
366
assert 'diff' not in f_remote
367
+
368
+
369
+ def test_new_project_sync (mc ):
370
+ """ Create a new project, download it, add a file and then do sync - it should not fail """
371
+
372
+ test_project = 'test_new_project_sync'
373
+ project = API_USER + '/' + test_project
374
+ project_dir = os .path .join (TMP_DIR , test_project ) # primary project dir for updates
375
+
376
+ cleanup (mc , project , [project_dir ])
377
+ # create remote project
378
+ mc .create_project (test_project )
379
+
380
+ # download the project
381
+ mc .download_project (project , project_dir )
382
+
383
+ # add a test file
384
+ shutil .copy (os .path .join (TEST_DATA_DIR , "test.txt" ), project_dir )
385
+
386
+ # do a full sync - it should not fail
387
+ mc .pull_project (project_dir )
388
+ mc .push_project (project_dir )
389
+
390
+ # make sure everything is up-to-date
391
+ mp = MerginProject (project_dir )
392
+ local_changes = mp .get_push_changes ()
393
+ assert not local_changes ["added" ] and not local_changes ["removed" ] and not local_changes ["updated" ]
0 commit comments