diff --git a/rclone_python/__init__.py b/rclone_python/__init__.py index 987a528..b13f7d1 100644 --- a/rclone_python/__init__.py +++ b/rclone_python/__init__.py @@ -1 +1 @@ -VERSION = "0.1.14" +VERSION = "0.1.15" diff --git a/rclone_python/utils.py b/rclone_python/utils.py index 3f07696..20ee748 100644 --- a/rclone_python/utils.py +++ b/rclone_python/utils.py @@ -21,7 +21,10 @@ def args2string(args: List[str]) -> str: # separate flags/ named arguments by a space - return " ".join(args) + if args: + return " " + " ".join(args) + + return "" def run_cmd( diff --git a/tests/test_utils.py b/tests/test_utils.py new file mode 100644 index 0000000..30ccb39 --- /dev/null +++ b/tests/test_utils.py @@ -0,0 +1,15 @@ +from rclone_python.utils import args2string + + +def test_args2string(): + args = [] + + result = args2string(args) + + assert result == "" + + args = ["--links", "--transfers", "40"] + + result = args2string(args) + + assert result == " --links --transfers 40"