Skip to content

Commit

Permalink
🚑 Fixes remove url API call in AdGuard 0.96
Browse files Browse the repository at this point in the history
Signed-off-by: Franck Nijhof <frenck@addons.community>
  • Loading branch information
frenck committed Jun 11, 2019
1 parent a70e555 commit aa06bf0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion adguardhome/filtering.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ async def add_url(self, name: str, url: str) -> bool:
async def remove_url(self, url: str) -> bool:
"""Remove a new filter subscription from AdGuard Home."""
response = await self._adguard._request(
"filtering/remove_url", method="POST", data="url={}".format(url)
"filtering/remove_url", method="POST", json_data={"url": url}
)
if response.rstrip() != "OK":
raise AdGuardHomeError(
Expand Down
4 changes: 2 additions & 2 deletions tests/test_filtering.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ async def test_remove_url(event_loop, aresponses):
"""Test remove filter subscription from AdGuard Home filtering."""
# Handle to run asserts on request in
async def response_handler(request):
data = await request.text()
assert data == "url=https://example.com/1.txt"
data = await request.json()
assert data == {"url": "https://example.com/1.txt"}
return aresponses.Response(status=200, text="OK")

aresponses.add(
Expand Down

0 comments on commit aa06bf0

Please sign in to comment.