22
33import pytest
44import pytest_check as check
5- from pyntcloud .io import TO_FILE
65from typer .testing import CliRunner
76
87from pointcloudset import Dataset
8+ from pointcloudset .io import POINTCLOUD_TO_FILE
99from pointcloudset .io .dataset .commandline import app
1010
11- TO_FILE_PYNTCLOUD = list (TO_FILE .keys ())
11+ TO_FILE_FORMATS = list (POINTCLOUD_TO_FILE .keys ())
12+
1213
1314runner = CliRunner ()
1415
@@ -53,9 +54,7 @@ def test_convert_one_rosfile_to_dir(ros_files, tmp_path: Path):
5354 check .equal (len (read_dataset .timestamps ), 2 )
5455
5556
56- def test_convert_all_rosfiles_to_dir (
57- tmp_path : Path , testdata_path : Path , monkeypatch : pytest .MonkeyPatch
58- ):
57+ def test_convert_all_rosfiles_to_dir (tmp_path : Path , testdata_path : Path , monkeypatch : pytest .MonkeyPatch ):
5958 monkeypatch .chdir (testdata_path )
6059 out_path = tmp_path .joinpath ("cli_dirs" )
6160 result = runner .invoke (
@@ -83,7 +82,7 @@ def test_convert_all_rosfiles_to_dir(
8382 check .equal (len (read_dataset .timestamps ), 2 )
8483
8584
86- @pytest .mark .parametrize ("fileformat" , TO_FILE_PYNTCLOUD )
85+ @pytest .mark .parametrize ("fileformat" , TO_FILE_FORMATS )
8786def test_convert_one_ros_file_frames_to_files (ros_files , tmp_path : Path , fileformat ):
8887 out_path = tmp_path .joinpath ("cli_files" )
8988 result = runner .invoke (
@@ -107,7 +106,7 @@ def test_convert_one_ros_file_frames_to_files(ros_files, tmp_path: Path, filefor
107106 check .equal (files [0 ].suffix .replace ("." , "" ), fileformat .lower ())
108107
109108
110- @pytest .mark .parametrize ("fileformat" , TO_FILE_PYNTCLOUD )
109+ @pytest .mark .parametrize ("fileformat" , TO_FILE_FORMATS )
111110def test_convert_one_ros_file_one_frame_to_files (ros_files , tmp_path : Path , fileformat ):
112111 out_path = tmp_path .joinpath ("cli_1file" )
113112 result = runner .invoke (
@@ -135,9 +134,7 @@ def test_convert_one_ros_file_one_frame_to_files(ros_files, tmp_path: Path, file
135134 check .equal (files [0 ].suffix .replace ("." , "" ), fileformat .lower ())
136135
137136
138- def test_convert_all_bags_frames_files (
139- tmp_path : Path , testdata_path : Path , monkeypatch : pytest .MonkeyPatch
140- ):
137+ def test_convert_all_bags_frames_files (tmp_path : Path , testdata_path : Path , monkeypatch : pytest .MonkeyPatch ):
141138 monkeypatch .chdir (testdata_path )
142139 out_path = tmp_path .joinpath ("cli_dirs_frames" )
143140 result = runner .invoke (
@@ -164,9 +161,7 @@ def test_convert_all_bags_frames_files(
164161
165162@pytest .mark .slow
166163@pytest .mark .parametrize ("filename" , ["big_uncomp.bag" , "big_comp.bag" ])
167- def test_convert_large_file_complete (
168- testdata_path_large : Path , tmp_path : Path , filename : str
169- ):
164+ def test_convert_large_file_complete (testdata_path_large : Path , tmp_path : Path , filename : str ):
170165 if testdata_path_large .exists ():
171166 len_target = 250
172167 testbag = testdata_path_large .joinpath (filename )
0 commit comments