From a3f74fef69eafc85d7e050fd0fb7b6b37b3029d3 Mon Sep 17 00:00:00 2001 From: Simon Date: Mon, 13 Mar 2023 00:06:43 +0100 Subject: [PATCH] fix(aptly-client): fix publish_update --- functional-tests/test.sh | 2 +- src/wakemebot/aptly.py | 10 ++++------ tests/test_aptly.py | 7 ++++--- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/functional-tests/test.sh b/functional-tests/test.sh index c3ce5a9..fc78669 100755 --- a/functional-tests/test.sh +++ b/functional-tests/test.sh @@ -8,4 +8,4 @@ export WAKEMEBOT_APTLY_CLIENT_KEY=LS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0tCk1JSUV2QU export WAKEMEBOT_APTLY_SERVER_URL=https://localhost:40000/api -wakemebot sync ./build --publish-prefix ":." +wakemebot sync ./build --publish-prefix ":./stable" diff --git a/src/wakemebot/aptly.py b/src/wakemebot/aptly.py index d5a5563..20648c1 100644 --- a/src/wakemebot/aptly.py +++ b/src/wakemebot/aptly.py @@ -170,12 +170,10 @@ def repo_add_packages(self, repo_name: str, upload_directory: str) -> None: def publish_update(self, prefix: str, gpg_key: str | None = None) -> None: try: - json = ( - { - "ForceOverwrite": True, - "Signing": {"GpgKey": gpg_key, "Batch": True}, - }, - ) + json = { + "ForceOverwrite": True, + "Signing": {"GpgKey": gpg_key, "Batch": True}, + } response = self._client.put(f"/publish/{prefix}", json=json) except httpx.HTTPError as e: raise AptlyClientError(str(e)) diff --git a/tests/test_aptly.py b/tests/test_aptly.py index 0038dcf..0f91436 100644 --- a/tests/test_aptly.py +++ b/tests/test_aptly.py @@ -248,9 +248,10 @@ def test_publish_update__does_put_request_with_prefix_on_publish_endpoint(httpx_ url="http://test_url/publish/myprefix:.", ) - expected_request_dict = [ - {"ForceOverwrite": True, "Signing": {"GpgKey": "mykey", "Batch": True}} - ] + expected_request_dict = { + "ForceOverwrite": True, + "Signing": {"GpgKey": "mykey", "Batch": True}, + } # When client = AptlyClient("http://test_url")