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:
@@ -124,29 +124,6 @@ async def test_reload_that_drops_the_dashboard_key_closes_its_routes(
|
||||
assert b"after" not in await asyncio.wait_for(stream.content.read(), 2)
|
||||
|
||||
|
||||
def test_reload_that_adds_a_dashboard_key_needs_a_restart(
|
||||
running: tuple[web.Application, Path], caplog: pytest.LogCaptureFixture
|
||||
) -> None:
|
||||
app, path = running
|
||||
_write(path, users={"new": {"devices": ["dev"]}}, dashboard={"key": "dash"})
|
||||
|
||||
with caplog.at_level(logging.WARNING, logger=LOG.name):
|
||||
assert _reload(app) is False
|
||||
assert "restart" in caplog.text and "dashboard.key" in caplog.text
|
||||
assert "dashboard" not in config.serve
|
||||
|
||||
|
||||
def test_reload_without_a_limit_leaves_the_job_limit_to_dl(running: tuple[web.Application, Path]) -> None:
|
||||
app, path = running
|
||||
_write(path, users={"old": {"devices": ["dev"]}})
|
||||
|
||||
assert _reload(app) is True
|
||||
assert DownloadQueueManager(max_concurrent_downloads=2).worker_speed_limit() is None
|
||||
requests_downloader.set_speed_limit(1_000_000)
|
||||
limiter = requests_downloader.speed_limiter
|
||||
assert limiter is not None and limiter.rate == 1_000_000
|
||||
|
||||
|
||||
def test_reload_with_a_limit_changes_the_job_share_only(running: tuple[web.Application, Path]) -> None:
|
||||
app, path = running
|
||||
_write(path, users={"old": {"devices": ["dev"]}}, global_speed_limit="6M")
|
||||
|
||||
Reference in New Issue
Block a user