Skip to content

Commit

Permalink
Modified test cases as per review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
cdp committed Dec 25, 2020
1 parent 768a17e commit 6879381
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cvat/apps/engine/tests/test_rest_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1845,7 +1845,7 @@ def setUpClass(cls):
cls._image_sizes[filename] = img_sizes

filename = "test_pointcloud_pcd.zip"
path = os.path.join(os.path.dirname(__file__), 'assets', 'test_pointcloud_pcd.zip')
path = os.path.join(os.path.dirname(__file__), 'assets', filename)
image_sizes = []
# container = av.open(path, 'r')
zip_file = zipfile.ZipFile(path)
Expand All @@ -1857,7 +1857,7 @@ def setUpClass(cls):
cls._image_sizes[filename] = image_sizes

filename = "test_velodyne_points.zip"
path = os.path.join(os.path.dirname(__file__), 'assets', 'test_velodyne_points.zip')
path = os.path.join(os.path.dirname(__file__), 'assets', filename)
image_sizes = []
# create zip instance

Expand All @@ -1867,7 +1867,7 @@ def setUpClass(cls):
root_path = os.path.abspath(os.path.split(path)[0])

for info in zip_file.namelist():
if info.rsplit(".", maxsplit=1)[-1] == "bin":
if os.path.splitext(info)[1][1:] == "bin":
zip_file.extract(info, root_path)
bin_path = os.path.abspath(os.path.join(root_path, info))
source_path.append(ValidateDimension.convert_bin_to_pcd(bin_path))
Expand All @@ -1876,7 +1876,7 @@ def setUpClass(cls):
zip_file.write(path, os.path.abspath(path.replace(root_path, "")))

for info in zip_file.namelist():
if info.rsplit(".", maxsplit=1)[-1] == "pcd":
if os.path.splitext(info)[1][1:] == "pcd":
with zip_file.open(info, "r") as file:
data = ValidateDimension.get_pcd_properties(file)
image_sizes.append((int(data["WIDTH"]), int(data["HEIGHT"])))
Expand Down

0 comments on commit 6879381

Please sign in to comment.