Skip to content

Commit 2af9b83

Browse files
varmar05wonder-sk
authored andcommitted
minor fixes
1 parent d76b002 commit 2af9b83

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

mergin/client.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -494,11 +494,15 @@ def project_file_changeset_info(self, project_path, file_path, version):
494494
return json.load(resp)
495495

496496
def get_projects_by_names(self, projects):
497-
""" Returns JSON with simplified projects' info for list of required projects
497+
""" Returns JSON with projects' info for list of required projects.
498+
The schema of the returned information is the same as the response from projects_list().
499+
500+
This is useful when we have a couple of Mergin projects available locally and we want to
501+
find out their status at once (e.g. whether there is a new version on the server).
498502
499503
:param projects: list of projects in the form 'namespace/project_name'
500504
:type projects: List[String]
501505
"""
502506

503507
resp = self.post("/v1/project/by_names", {"projects": projects}, {"Content-Type": "application/json"})
504-
return json.load(resp)
508+
return json.load(resp)

mergin/test/test_client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -658,6 +658,7 @@ def test_get_projects_by_name(mc):
658658
mc.create_project(name)
659659

660660
resp = mc.get_projects_by_names(list(test_projects.values()))
661+
assert len(resp) == len(test_projects)
661662
for name, full_name in test_projects.items():
662663
assert full_name in resp
663664
assert resp[full_name]["name"] == name

0 commit comments

Comments
 (0)