Skip to content

Commit

Permalink
Fix properties when deploying #201
Browse files Browse the repository at this point in the history
  • Loading branch information
aslheyrr committed Oct 29, 2024
1 parent d4f2708 commit 7cd46e6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pyartifactory/objects/artifact.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
7 changes: 3 additions & 4 deletions tests/test_artifacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(';')}",
Expand Down

0 comments on commit 7cd46e6

Please sign in to comment.