Skip to content

Commit 45386ac

Browse files
committed
add move test case
1 parent 207fe34 commit 45386ac

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

test/test_sync.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -607,3 +607,29 @@ def test_google_drive_backend(mc):
607607
# files in mergin project still exist (copy mode)
608608
assert os.path.exists(os.path.join(work_project_dir, "img1.png"))
609609
assert os.path.exists(os.path.join(work_project_dir, "images", "img2.jpg"))
610+
611+
# test for moving files
612+
cleanup(mc, full_project_name, [work_project_dir])
613+
prepare_mergin_project(mc, full_project_name)
614+
615+
# patch config to fit testing purposes
616+
config.update(
617+
{
618+
"OPERATION_MODE": "move",
619+
}
620+
)
621+
622+
google_drive_delete_folder(GoogleDriveDriver(config), GOOGLE_DRIVE_FOLDER)
623+
624+
main()
625+
626+
google_drive_files = google_drive_list_files_in_folder(
627+
GoogleDriveDriver(config), GOOGLE_DRIVE_FOLDER
628+
)
629+
630+
assert "img1.png" in google_drive_files
631+
assert "images/img2.jpg" in google_drive_files
632+
633+
# files in mergin project still exist (copy mode)
634+
assert os.path.exists(os.path.join(work_project_dir, "img1.png")) is False
635+
assert os.path.exists(os.path.join(work_project_dir, "images", "img2.jpg")) is False

0 commit comments

Comments
 (0)