Skip to content

Commit

Permalink
fix(aptly-client): fix publish_update
Browse files Browse the repository at this point in the history
  • Loading branch information
fyhertz committed Mar 12, 2023
1 parent 1b47b93 commit a3f74fe
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion functional-tests/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
10 changes: 4 additions & 6 deletions src/wakemebot/aptly.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
7 changes: 4 additions & 3 deletions tests/test_aptly.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit a3f74fe

Please sign in to comment.