FCP7 xmeml declares version 5, a clipitem per scene, and a shared reference.
(tmp_path: Path)
| 399 | |
| 400 | |
| 401 | def test_write_scene_list_fcp7(tmp_path: Path): |
| 402 | """FCP7 xmeml declares version 5, a clipitem per scene, and a shared <file id> reference.""" |
| 403 | scenes = _fake_scenes(_FPS_NTSC, [(0, 48), (48, 96)]) |
| 404 | output_path = tmp_path / "scenes.xml" |
| 405 | write_scene_list_fcp7( |
| 406 | output_path=output_path, |
| 407 | scene_list=scenes, |
| 408 | video_path=tmp_path / "source.mp4", |
| 409 | frame_rate=_FPS_NTSC, |
| 410 | frame_size=(1920, 1080), |
| 411 | source_duration=FrameTimecode(240, fps=_FPS_NTSC), |
| 412 | ) |
| 413 | |
| 414 | root = ElementTree.parse(output_path).getroot() |
| 415 | assert root.tag == "xmeml" |
| 416 | assert root.attrib["version"] == "5" |
| 417 | |
| 418 | ntsc = root.find("project/sequence/rate/ntsc") |
| 419 | assert ntsc is not None and ntsc.text == "True" |
| 420 | |
| 421 | clipitems = root.findall("project/sequence/media/video/track/clipitem") |
| 422 | assert len(clipitems) == 2 |
| 423 | # First clipitem carries the full <file> declaration; later ones reference it by id. |
| 424 | first_file = clipitems[0].find("file") |
| 425 | assert first_file is not None and first_file.attrib["id"] == "file1" |
| 426 | pathurl = first_file.find("pathurl") |
| 427 | assert pathurl is not None and pathurl.text is not None |
| 428 | assert pathurl.text.startswith("file://") |
| 429 | assert first_file.find("duration") is not None |
| 430 | second_file = clipitems[1].find("file") |
| 431 | assert second_file is not None and second_file.attrib["id"] == "file1" |
| 432 | assert second_file.find("pathurl") is None |
| 433 | |
| 434 | |
| 435 | def test_write_scene_list_fcp7_cfr_sets_ntsc_false(tmp_path: Path): |
nothing calls this directly
no test coverage detected