feat: add isolated utility export modes
This commit is contained in:
@@ -84,6 +84,7 @@ class ConfigurationTests(unittest.TestCase):
|
||||
self.assertEqual(config.mqtt.router_echo_grace_seconds, 2.0)
|
||||
self.assertEqual(config.downloads.export_directory, Path("exports"))
|
||||
self.assertEqual(config.downloads.export_max_height, 1080)
|
||||
self.assertEqual(config.downloads.export_max_workers, 1)
|
||||
self.assertEqual(config.downloads.max_queued_exports, 20)
|
||||
|
||||
def test_documented_environment_overrides_apply(self):
|
||||
@@ -190,9 +191,23 @@ class ConfigurationTests(unittest.TestCase):
|
||||
with self.assertRaisesRegex(ConfigError, "safe relative directory"):
|
||||
load_config(path, environ={})
|
||||
|
||||
def test_export_directory_cannot_overlap_player_slot_storage(self):
|
||||
invalid = ("slot1", "SLOT10/exports", ".controller-trash/exports")
|
||||
for value in invalid:
|
||||
with self.subTest(value=value), tempfile.TemporaryDirectory() as directory:
|
||||
path = Path(directory) / "config.yaml"
|
||||
path.write_text(
|
||||
f"downloads:\n export_directory: {value!r}\n",
|
||||
encoding="utf-8",
|
||||
)
|
||||
with self.assertRaisesRegex(ConfigError, "slot storage"):
|
||||
load_config(path, environ={})
|
||||
|
||||
def test_export_limits_are_bounded_positive_integers(self):
|
||||
cases = (
|
||||
("export_max_height", 0),
|
||||
("export_max_workers", 0),
|
||||
("export_max_workers", 11),
|
||||
("max_queued_exports", 0),
|
||||
("max_queued_exports", 1001),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user