mirror of
https://github.com/denizsafak/abogen.git
synced 2026-07-18 05:40:26 +02:00
Reformat using black
This commit is contained in:
@@ -30,16 +30,22 @@ def _sample_job(tmp_path: Path) -> Job:
|
||||
)
|
||||
|
||||
|
||||
def test_prepare_project_layout_uses_timestamped_folder(monkeypatch: pytest.MonkeyPatch, tmp_path: Path) -> None:
|
||||
def test_prepare_project_layout_uses_timestamped_folder(
|
||||
monkeypatch: pytest.MonkeyPatch, tmp_path: Path
|
||||
) -> None:
|
||||
job = _sample_job(tmp_path)
|
||||
monkeypatch.setattr(
|
||||
"abogen.webui.conversion_runner._output_timestamp_token",
|
||||
lambda: "20250101-120000",
|
||||
)
|
||||
|
||||
project_root, audio_dir, subtitle_dir, metadata_dir = _prepare_project_layout(job, tmp_path)
|
||||
project_root, audio_dir, subtitle_dir, metadata_dir = _prepare_project_layout(
|
||||
job, tmp_path
|
||||
)
|
||||
|
||||
assert project_root.name.startswith("20250101-120000_Sample_Title"), project_root.name
|
||||
assert project_root.name.startswith(
|
||||
"20250101-120000_Sample_Title"
|
||||
), project_root.name
|
||||
assert audio_dir == project_root
|
||||
assert subtitle_dir == project_root
|
||||
assert metadata_dir is None
|
||||
@@ -48,7 +54,9 @@ def test_prepare_project_layout_uses_timestamped_folder(monkeypatch: pytest.Monk
|
||||
assert output_path == project_root / "Sample_Title.mp3"
|
||||
|
||||
|
||||
def test_prepare_project_layout_creates_project_subdirs(monkeypatch: pytest.MonkeyPatch, tmp_path: Path) -> None:
|
||||
def test_prepare_project_layout_creates_project_subdirs(
|
||||
monkeypatch: pytest.MonkeyPatch, tmp_path: Path
|
||||
) -> None:
|
||||
job = _sample_job(tmp_path)
|
||||
job.save_as_project = True
|
||||
monkeypatch.setattr(
|
||||
@@ -56,7 +64,9 @@ def test_prepare_project_layout_creates_project_subdirs(monkeypatch: pytest.Monk
|
||||
lambda: "20250101-120500",
|
||||
)
|
||||
|
||||
project_root, audio_dir, subtitle_dir, metadata_dir = _prepare_project_layout(job, tmp_path)
|
||||
project_root, audio_dir, subtitle_dir, metadata_dir = _prepare_project_layout(
|
||||
job, tmp_path
|
||||
)
|
||||
|
||||
assert audio_dir == project_root / "audio"
|
||||
assert subtitle_dir == project_root / "subtitles"
|
||||
|
||||
Reference in New Issue
Block a user