From 7cd46e6d53afe8230214413b8ccc1bbf52d1e79a Mon Sep 17 00:00:00 2001 From: aslheyrr <7197186+aslheyrr@users.noreply.github.com> Date: Tue, 29 Oct 2024 18:38:04 -0500 Subject: [PATCH] Fix properties when deploying #201 --- pyartifactory/objects/artifact.py | 2 +- tests/test_artifacts.py | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/pyartifactory/objects/artifact.py b/pyartifactory/objects/artifact.py index 180cf40..dd09c71 100644 --- a/pyartifactory/objects/artifact.py +++ b/pyartifactory/objects/artifact.py @@ -100,7 +100,7 @@ def deploy( else: properties_param_str = "" if properties is not None: - properties_param_str = self._format_properties(properties) + properties_param_str = ";".join(f"{k}={value}" for k, values in properties.items() for value in values) route = ";".join(s for s in [artifact_folder.as_posix(), properties_param_str] if s) artifact_check_sums = Checksums.generate(local_file) headers = { diff --git a/tests/test_artifacts.py b/tests/test_artifacts.py index 0d3f880..8143012 100644 --- a/tests/test_artifacts.py +++ b/tests/test_artifacts.py @@ -464,10 +464,9 @@ def test_deploy_artifact_with_properties_success(): @responses.activate def test_deploy_artifact_with_multiple_properties_success(): - properties_param_str = "" - for k, v in ARTIFACT_MULTIPLE_PROPERTIES.properties.items(): - values_str = ",".join(list(map(urllib.parse.quote, v))) - properties_param_str += f"{k}={values_str};" + properties_param_str = ";".join( + f"{k}={value}" for k, values in ARTIFACT_MULTIPLE_PROPERTIES.properties.items() for value in values + ) responses.add( responses.PUT, f"{URL}/{ARTIFACT_PATH};{properties_param_str.rstrip(';')}",