"""Unit tests for `runner.helpers.fdr_reader.archive_size_bytes`. The full `iter_records` parser is owned by AZ-441; AZ-406 only commits to the directory-size helper. """ from __future__ import annotations from pathlib import Path import pytest from runner.helpers.fdr_reader import archive_size_bytes def test_archive_size_zero_for_missing_root(tmp_path: Path) -> None: assert archive_size_bytes(tmp_path / "does-not-exist") == 0 def test_archive_size_sums_nested_files(tmp_path: Path) -> None: # Arrange (tmp_path / "a").mkdir() (tmp_path / "a" / "b.bin").write_bytes(b"x" * 100) (tmp_path / "a" / "c.bin").write_bytes(b"y" * 50) (tmp_path / "top.bin").write_bytes(b"z" * 200) # Act size = archive_size_bytes(tmp_path) # Assert assert size == 350 def test_iter_records_raises_until_az441_lands() -> None: """Until AZ-441 fills the parser in, callers must see a clear error.""" from runner.helpers.fdr_reader import iter_records with pytest.raises(NotImplementedError, match="AZ-441"): next(iter_records(Path("/tmp/nonexistent")))