From 4eb13e7d0b3ee3302db293a398a448d24ff4bc89 Mon Sep 17 00:00:00 2001 From: Niklas Freund Date: Mon, 25 Nov 2024 10:23:11 +0100 Subject: [PATCH] fix: test_validate_empty_frames for raillabel 4 --- tests/conftest.py | 14 +++++--------- .../test_validate_empty_frames.py | 6 ++---- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 79914f3..eac2d85 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -5,6 +5,7 @@ import json import typing as t from pathlib import Path +from uuid import UUID import pytest import raillabel @@ -88,11 +89,10 @@ def empty_scene() -> raillabel.Scene: @pytest.fixture def default_frame(empty_annotation) -> raillabel.format.Frame: return raillabel.format.Frame( - uid=0, timestamp=None, sensors={}, frame_data={}, - annotations={"0fb4fc0b-3eeb-443a-8dd0-2caf9912d016": empty_annotation}, + annotations={UUID("0fb4fc0b-3eeb-443a-8dd0-2caf9912d016"): empty_annotation}, ) @@ -104,13 +104,9 @@ def empty_frame() -> raillabel.format.Frame: @pytest.fixture def empty_annotation() -> raillabel.format.Bbox: return raillabel.format.Bbox( - uid="1f654afe-0a18-497f-9db8-afac360ce94c", - object=raillabel.format.Object( - uid="7df959d7-0ec2-4722-8b62-bb2e529de2ec", - name="person0000", - type="person", - ), - sensor=None, + object_id=UUID("7df959d7-0ec2-4722-8b62-bb2e529de2ec"), + sensor_id="IGNORE_THIS", pos=raillabel.format.Point2d(0.0, 0.0), size=raillabel.format.Size2d(0.0, 0.0), + attributes={}, ) diff --git a/tests/test_raillabel_providerkit/validation/validate_empty_frame/test_validate_empty_frames.py b/tests/test_raillabel_providerkit/validation/validate_empty_frame/test_validate_empty_frames.py index 5b1f3c8..7f1eea1 100644 --- a/tests/test_raillabel_providerkit/validation/validate_empty_frame/test_validate_empty_frames.py +++ b/tests/test_raillabel_providerkit/validation/validate_empty_frame/test_validate_empty_frames.py @@ -2,7 +2,6 @@ # SPDX-License-Identifier: Apache-2.0 import pytest -import raillabel from raillabel_providerkit.validation.validate_empty_frames.validate_empty_frames import ( _is_frame_empty, @@ -10,9 +9,8 @@ ) -def test_is_frame_empty__true(): - frame = raillabel.format.Frame(uid=0, annotations={}) - assert _is_frame_empty(frame) +def test_is_frame_empty__true(empty_frame): + assert _is_frame_empty(empty_frame) def test_is_frame_empty__false(empty_annotation, empty_frame):