Skip to content

Commit 369b4fa

Browse files
authored
Merge pull request #6 from Polyconseil/rsebille/fix_prefix_quoting
Properly quote the root prefix ('.')
2 parents 4e35c9c + 486429b commit 369b4fa

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

aptly_api/parts/publish.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ def endpoint_from_response(api_response: Union[Dict[str, str], Dict[str, List[st
4040

4141
@staticmethod
4242
def escape_prefix(prefix: str) -> str:
43+
if prefix == ".":
44+
return ":."
4345
if "/" in prefix:
4446
# prefix has not yet been quoted as described at
4547
# https://www.aptly.info/doc/api/publish/

aptly_api/tests/publish.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,3 +281,7 @@ def test_escape_prefix(self, *args: Any, **kwargs: Any) -> None:
281281
self.papi.escape_prefix("test/a"),
282282
"test_a"
283283
)
284+
self.assertEqual(
285+
self.papi.escape_prefix("."),
286+
":."
287+
)

0 commit comments

Comments
 (0)