Skip to content

Commit 5aa0ea1

Browse files
varmar05wonder-sk
authored andcommitted
minor fixes
1 parent 05ddd16 commit 5aa0ea1

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

mergin/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ def download_project(self, project_path, directory, version=None):
356356
:param project_path: Project's full name (<namespace>/<name>)
357357
:type project_path: String
358358
359-
:param version: Project version to download
359+
:param version: Project version to download, e.g. v42
360360
:type version: String
361361
362362
:param directory: Target directory

mergin/test/test_client.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -687,16 +687,13 @@ def test_download_versions(mc):
687687
project_info = mc.project_info(project)
688688
assert project_info['version'] == 'v2'
689689

690-
info_v1 = mc.project_info(project, version='v1')
691690
mc.download_project(project, project_dir_v1, 'v1')
692-
for f in info_v1["files"]:
693-
assert os.path.exists(os.path.join(project_dir_v1, f["path"]))
691+
assert os.path.exists(os.path.join(project_dir_v1, 'base.gpkg'))
692+
assert not os.path.exists(os.path.join(project_dir_v2, f_added)) # added only in v2
694693

695694
mc.download_project(project, project_dir_v2, 'v2')
696-
info_v2 = mc.project_info(project, version='v2')
697695
assert os.path.exists(os.path.join(project_dir_v2, f_added))
698-
for f in info_v2["files"]:
699-
assert os.path.exists(os.path.join(project_dir_v2, f["path"]))
696+
assert os.path.exists(os.path.join(project_dir_v1, 'base.gpkg')) # added in v1 but still present in v2
700697

701698
# try to download not-existing version
702699
with pytest.raises(ClientError):

0 commit comments

Comments
 (0)