feat(config): add workers field and --workers CLI flag

Add parallel download worker-count configuration through all three
config layers: Config dataclass (workers=3 default), YAML parsing
with InvalidWorkersError validation, and -w/--workers CLI flag with
three-layer resolution (CLI > config > hardcoded 3). 6 new tests.

Closes #12
This commit is contained in:
AlexKucera committed 2026-06-03 17:07:50 +02:00
1 parent b02884fe46
commit 7a0d8c1d18
11 files changed
+329 -2

No files matched your search

+3
View File
@@ -159,6 +159,7 @@ class TestFailureIsolationCLI:
mock_config.return_value.username = "alice"
mock_config.return_value.password = "secret"
mock_config.return_value.output_dir = "./audiobooks"
mock_config.return_value.workers = 3
mock_instance = mock_client_cls.return_value
mock_instance.authenticate.return_value = None
@@ -221,6 +222,8 @@ class TestFatalVsBookLevel:
):
mock_config.return_value.username = "alice"
mock_config.return_value.password = "wrong"
mock_config.return_value.output_dir = "./audiobooks"
mock_config.return_value.workers = 3
mock_instance = mock_client_cls.return_value
mock_instance.authenticate.side_effect = AuthError("Auth failed (401)")