|
2 | 2 | import json |
3 | 3 | import os |
4 | 4 | import subprocess |
| 5 | +import tempfile |
5 | 6 | import zipfile |
6 | 7 | from pathlib import Path |
7 | 8 |
|
@@ -647,6 +648,30 @@ def ffmpeg_installed(): |
647 | 648 | is_ffmpeg_installed = ffmpeg_installed() |
648 | 649 |
|
649 | 650 |
|
| 651 | +def test_sample_video_relpath(): |
| 652 | + if not is_ffmpeg_installed: |
| 653 | + pytest.skip("skip because ffmpeg not installed") |
| 654 | + |
| 655 | + with tempfile.TemporaryDirectory() as dir: |
| 656 | + x = subprocess.run( |
| 657 | + f"{EXECUTABLE} sample_video --rerun tests/integration/mapillary_tools_process_images_provider/gopro_data/hero8.mp4 {dir}", |
| 658 | + shell=True, |
| 659 | + ) |
| 660 | + assert x.returncode == 0, x.stderr |
| 661 | + |
| 662 | + |
| 663 | +def test_sample_video_relpath_dir(): |
| 664 | + if not is_ffmpeg_installed: |
| 665 | + pytest.skip("skip because ffmpeg not installed") |
| 666 | + |
| 667 | + with tempfile.TemporaryDirectory() as dir: |
| 668 | + x = subprocess.run( |
| 669 | + f"{EXECUTABLE} sample_video --rerun --video_start_time 2021_10_10_10_10_10_123 tests/integration {dir}", |
| 670 | + shell=True, |
| 671 | + ) |
| 672 | + assert x.returncode == 0, x.stderr |
| 673 | + |
| 674 | + |
650 | 675 | def test_sample_video(setup_data: py.path.local): |
651 | 676 | if not is_ffmpeg_installed: |
652 | 677 | pytest.skip("skip because ffmpeg not installed") |
@@ -699,10 +724,10 @@ def test_video_process(setup_data: py.path.local): |
699 | 724 | with gpx_file.open("w") as fp: |
700 | 725 | fp.write(GPX_CONTENT) |
701 | 726 | x = subprocess.run( |
702 | | - f"{EXECUTABLE} video_process {PROCESS_FLAGS} --video_start_time 2018_06_08_13_23_34_123 --geotag_source gpx --geotag_source_path {gpx_file} {setup_data} {setup_data.join('my_samples')}", |
| 727 | + f"{EXECUTABLE} video_process {PROCESS_FLAGS} --skip_process_errors --video_start_time 2018_06_08_13_23_34_123 --geotag_source gpx --geotag_source_path {gpx_file} {setup_data} {setup_data.join('my_samples')}", |
703 | 728 | shell=True, |
704 | 729 | ) |
705 | | - assert x.returncode != 0, x.stderr |
| 730 | + assert x.returncode == 0, x.stderr |
706 | 731 | with open(desc_path) as fp: |
707 | 732 | descs = json.load(fp) |
708 | 733 | assert 1 == len(find_desc_errors(descs)) |
|
0 commit comments