Skip to content

Commit

Permalink
Merge pull request #6 from Polyconseil/rsebille/fix_prefix_quoting
Browse files Browse the repository at this point in the history
Properly quote the root prefix ('.')
  • Loading branch information
jdelic authored Oct 18, 2017
2 parents 4e35c9c + 486429b commit 369b4fa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions aptly_api/parts/publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ def endpoint_from_response(api_response: Union[Dict[str, str], Dict[str, List[st

@staticmethod
def escape_prefix(prefix: str) -> str:
if prefix == ".":
return ":."
if "/" in prefix:
# prefix has not yet been quoted as described at
# https://www.aptly.info/doc/api/publish/
Expand Down
4 changes: 4 additions & 0 deletions aptly_api/tests/publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,3 +281,7 @@ def test_escape_prefix(self, *args: Any, **kwargs: Any) -> None:
self.papi.escape_prefix("test/a"),
"test_a"
)
self.assertEqual(
self.papi.escape_prefix("."),
":."
)

0 comments on commit 369b4fa

Please sign in to comment.