Test `save-qp` command with and without a custom filename format.
(tmp_path: Path)
| 724 | |
| 725 | |
| 726 | def test_cli_save_qp(tmp_path: Path): |
| 727 | """Test `save-qp` command with and without a custom filename format.""" |
| 728 | EXPECTED_QP_CONTENTS = """ |
| 729 | 0 I -1 |
| 730 | 90 I -1 |
| 731 | """ |
| 732 | for filename in (None, "custom.txt"): |
| 733 | filename_format = f"--filename {filename}" if filename else "" |
| 734 | assert ( |
| 735 | invoke_scenedetect( |
| 736 | f"-i {{VIDEO}} time -e 95 {{DETECTOR}} save-qp {filename_format}", |
| 737 | output_dir=tmp_path, |
| 738 | ) |
| 739 | == 0 |
| 740 | ) |
| 741 | output_path = tmp_path.joinpath(filename if filename else f"{DEFAULT_VIDEO_NAME}.qp") |
| 742 | assert os.path.exists(output_path) |
| 743 | assert output_path.read_text() == EXPECTED_QP_CONTENTS[1:] |
| 744 | |
| 745 | |
| 746 | def test_cli_save_qp_start_offset(tmp_path: Path): |
nothing calls this directly
no test coverage detected