-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add help URL in /offliners/{offliner} API endpoint
- Loading branch information
Showing
7 changed files
with
112 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
dispatcher/backend/src/tests/integration/routes/offliners/test_offliners_routes.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import pytest | ||
|
||
from common.enum import Offliner | ||
|
||
|
||
def test_list_offliners(client): | ||
url = "/offliners/" | ||
response = client.get(url) | ||
assert response.status_code == 200 | ||
response_json = response.get_json() | ||
assert "items" in response_json | ||
assert "meta" in response_json | ||
assert "count" in response_json["meta"] | ||
assert len(response_json["items"]) == response_json["meta"]["count"] | ||
|
||
|
||
@pytest.mark.parametrize("offliner", Offliner.all()) | ||
def test_get_offliner(client, offliner): | ||
url = f"/offliners/{offliner}" | ||
response = client.get(url) | ||
assert response.status_code == 200 | ||
response_json = response.get_json() | ||
assert "flags" in response_json | ||
assert "help" in response_json | ||
assert ( | ||
response_json["help"] | ||
== f"https://github.com/openzim/{offliner}/wiki/Frequently-Asked-Questions" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters