Skip to content

Commit

Permalink
fix: test_validate_empty_frames for raillabel 4
Browse files Browse the repository at this point in the history
  • Loading branch information
nalquas committed Nov 25, 2024
1 parent 59d8fec commit 4eb13e7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
14 changes: 5 additions & 9 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import json
import typing as t
from pathlib import Path
from uuid import UUID

import pytest
import raillabel
Expand Down Expand Up @@ -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},
)


Expand All @@ -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={},
)
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,15 @@
# SPDX-License-Identifier: Apache-2.0

import pytest
import raillabel

from raillabel_providerkit.validation.validate_empty_frames.validate_empty_frames import (
_is_frame_empty,
validate_empty_frames,
)


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):
Expand Down

0 comments on commit 4eb13e7

Please sign in to comment.