Skip to content

Commit 4500d0b

Browse files
committed
Fix tests and codestyle
1 parent a577092 commit 4500d0b

File tree

5 files changed

+107
-106
lines changed

5 files changed

+107
-106
lines changed

mergin/client.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class MerginClient:
8181
"""
8282

8383
def __init__(self, url=None, auth_token=None, login=None, password=None, plugin_version=None, proxy_config=None):
84-
self.url = url if url is not None else MerginClient.default_url()
84+
self.url = (url if url is not None else MerginClient.default_url()).rstrip("/") + "/"
8585
self._auth_params = None
8686
self._auth_session = None
8787
self._user_info = None
@@ -453,7 +453,8 @@ def create_project(self, project_name, is_public=False, namespace=None):
453453

454454
def create_project_and_push(self, project_name, directory, is_public=False, namespace=None):
455455
"""
456-
Convenience method to create project and push the initial version right after that.
456+
Convenience method to create project and push the the files right after that.
457+
Creates two versions when directory contains blocking and non-blocking changes.
457458
458459
:param project_name: Project's full name (<namespace>/<name>)
459460
:type project_name: String
@@ -877,9 +878,9 @@ def push_project(self, directory):
877878
:type directory: String
878879
"""
879880
jobs = push_project_async(self, directory)
881+
if not jobs:
882+
return # there is nothing to push (or we only deleted some files)
880883
for job in jobs:
881-
if job is None:
882-
return # there is nothing to push (or we only deleted some files)
883884
push_project_wait(job)
884885
push_project_finalize(job)
885886

mergin/client_push.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,4 +415,3 @@ def remove_diff_files(job) -> None:
415415
diff_file = job.mp.fpath_meta(change["diff"]["path"])
416416
if os.path.exists(diff_file):
417417
os.remove(diff_file)
418-

0 commit comments

Comments
 (0)