mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-11-29 12:35:13 +00:00
fix(api): redact error replies, lock segment url lookups, refuse unresolvable proxy hosts and recheck job proxies at start
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import inspect
|
||||
import re
|
||||
from pathlib import Path
|
||||
|
||||
import click
|
||||
import pytest
|
||||
@@ -37,6 +39,14 @@ def test_the_openapi_yaml_names_each_api_dl_option_and_no_other():
|
||||
assert properties.keys() - DEFAULT_DOWNLOAD_PARAMS.keys() == {"service", "title_id", "remote", "client_name", "cdm"}
|
||||
|
||||
|
||||
def test_the_endpoint_docs_name_each_api_dl_option():
|
||||
"""The POST /api/download table of the endpoint reference has a row for every dl option the API takes."""
|
||||
page = (Path(__file__).parents[3] / "docs/dev/rest-api/endpoints.md").read_text(encoding="utf-8")
|
||||
section = page.split("### `POST /api/download`", 1)[1].split("\n### ", 1)[0]
|
||||
rows = [line.split("|")[1] for line in section.splitlines() if line.startswith("| `")]
|
||||
assert DEFAULT_DOWNLOAD_PARAMS.keys() <= {name for row in rows for name in re.findall(r"`(\w+)`", row)}
|
||||
|
||||
|
||||
def test_api_defaults_cast_to_the_dl_defaults():
|
||||
"""``wanted`` keeps its API default of no keys, which dl reads as every title, like the CLI's None."""
|
||||
ctx = click.Context(dl.cli)
|
||||
|
||||
Reference in New Issue
Block a user