mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-12-06 07:55:10 +00:00
test: delete slow, timing-based and redundant tests
This commit is contained in:
@@ -17,26 +17,6 @@ def runner() -> CliRunner:
|
||||
return CliRunner()
|
||||
|
||||
|
||||
def test_serve_help_lists_documented_flags(runner: CliRunner) -> None:
|
||||
result = runner.invoke(serve, ["--help"])
|
||||
assert result.exit_code == 0
|
||||
out = result.output
|
||||
for flag in (
|
||||
"--host",
|
||||
"--port",
|
||||
"--caddy",
|
||||
"--api-only",
|
||||
"--no-widevine",
|
||||
"--no-playready",
|
||||
"--no-key",
|
||||
"--debug-api",
|
||||
"--debug",
|
||||
"--remote-only",
|
||||
"--quiet",
|
||||
):
|
||||
assert flag in out, f"missing flag in --help: {flag}"
|
||||
|
||||
|
||||
def test_serve_api_only_with_no_widevine_rejected(runner: CliRunner, monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
"""`--api-only` is mutually exclusive with `--no-widevine`/`--no-playready`."""
|
||||
monkeypatch.setenv("UNSHACKLE_NO_RUN", "1") # belt-and-braces; not currently checked
|
||||
@@ -172,20 +152,3 @@ def test_bad_rate_limit_config_stops_the_server(
|
||||
"""A tier or rate limit the reader would silently treat as "no limit" must fail at startup."""
|
||||
started, output = start_serve(runner, monkeypatch, serve_cfg)
|
||||
assert not started and expected in output
|
||||
|
||||
|
||||
def test_good_rate_limit_config_starts(runner: CliRunner, monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
started, output = start_serve(
|
||||
runner,
|
||||
monkeypatch,
|
||||
{"tiers": {"bot": {"rate_limit": 600}}, "users": {"k": {"username": "bot", "tier": "bot"}}},
|
||||
)
|
||||
assert started, output
|
||||
|
||||
|
||||
def test_serve_cdm_only_with_remote_only_rejected(runner: CliRunner) -> None:
|
||||
"""`--cdm-only` is mutually exclusive with `--api-only` and `--remote-only`; the check runs before config."""
|
||||
result = runner.invoke(serve, ["--cdm-only", "--remote-only"])
|
||||
assert result.exit_code != 0
|
||||
output = re.sub(r"\x1b\[[0-9;]*m", "", result.output or str(result.exception))
|
||||
assert "Cannot use --cdm-only" in output
|
||||
|
||||
Reference in New Issue
Block a user