From 9bf564324fa3744328229626ade7a04ee37d5385 Mon Sep 17 00:00:00 2001 From: Kotaro Uetake <60615504+ktro2828@users.noreply.github.com> Date: Wed, 13 Nov 2024 00:14:47 +0900 Subject: [PATCH] test: add unit testings for schema (#29) * test: add unit testings for schema tables Signed-off-by: ktro2828 * test: add unit tesing for schema builder Signed-off-by: ktro2828 --------- Signed-off-by: ktro2828 --- tests/schema/conftest.py | 330 ++++++++++++++++++ tests/schema/tables/test_attribute_table.py | 11 + .../tables/test_calibrated_sensor_table.py | 11 + tests/schema/tables/test_category_table.py | 11 + tests/schema/tables/test_ego_pose_table.py | 11 + tests/schema/tables/test_instance_table.py | 11 + tests/schema/tables/test_log_table.py | 11 + tests/schema/tables/test_map_table.py | 11 + tests/schema/tables/test_object_ann_table.py | 11 + .../tables/test_sample_annotation_table.py | 11 + tests/schema/tables/test_sample_data_table.py | 12 +- tests/schema/tables/test_sample_table.py | 11 + tests/schema/tables/test_sensor_table.py | 12 +- tests/schema/tables/test_surface_ann_table.py | 11 + ...ity_schema.py => test_visibility_table.py} | 12 +- tests/schema/test_schema_builder.py | 71 ++++ 16 files changed, 555 insertions(+), 3 deletions(-) create mode 100644 tests/schema/conftest.py create mode 100644 tests/schema/tables/test_attribute_table.py create mode 100644 tests/schema/tables/test_calibrated_sensor_table.py create mode 100644 tests/schema/tables/test_category_table.py create mode 100644 tests/schema/tables/test_ego_pose_table.py create mode 100644 tests/schema/tables/test_instance_table.py create mode 100644 tests/schema/tables/test_log_table.py create mode 100644 tests/schema/tables/test_map_table.py create mode 100644 tests/schema/tables/test_object_ann_table.py create mode 100644 tests/schema/tables/test_sample_annotation_table.py create mode 100644 tests/schema/tables/test_sample_table.py create mode 100644 tests/schema/tables/test_surface_ann_table.py rename tests/schema/tables/{test_visibility_schema.py => test_visibility_table.py} (68%) create mode 100644 tests/schema/test_schema_builder.py diff --git a/tests/schema/conftest.py b/tests/schema/conftest.py new file mode 100644 index 0000000..f13b52a --- /dev/null +++ b/tests/schema/conftest.py @@ -0,0 +1,330 @@ +import tempfile +from typing import Any, Generator + +import pytest + +from t4_devkit.common.io import save_json + + +# === Attribute === +@pytest.fixture(scope="module") +def attribute_dict() -> dict: + """Return a dummy attribute record as dictionary.""" + return { + "token": "d3262a477673e1306db1791203be81d4", + "name": "vehicle_state.moving", + "description": "Is the vehicle moving?", + } + + +@pytest.fixture(scope="module") +def attribute_json(attribute_dict) -> Generator[str, Any, None]: + """Return a file path of dummy attribute record.""" + with tempfile.NamedTemporaryFile(suffix=".json", delete=False) as f: + save_json([attribute_dict], f.name) + yield f.name + + +# === CalibratedSensor === +@pytest.fixture(scope="module") +def calibrated_sensor_dict() -> dict: + """Return a dummy calibrated sensor record as dictionary.""" + return { + "token": "16fa3d3ffc292b63027b2547119bbda6", + "sensor_token": "06f6037f6f687ec0c3b3b3d09cf414a8", + "translation": [1.0, 1.0, 1.0], + "rotation": [1.0, 0.0, 0.0, 0.0], + "camera_intrinsic": [ + [1042.08972, 0.0, 732.18615], + [0.0, 1044.20679, 547.14188], + [0.0, 0.0, 1.0], + ], + "camera_distortion": [0, 0, 0, 0, 0], + } + + +@pytest.fixture(scope="module") +def calibrated_sensor_json(calibrated_sensor_dict) -> Generator[str, Any, None]: + """Return a file path of dummy calibrated sensor record.""" + with tempfile.NamedTemporaryFile(suffix=".json", delete=False) as f: + save_json([calibrated_sensor_dict], f.name) + yield f.name + + +# === Category === +@pytest.fixture(scope="module") +def category_dict() -> dict: + """Return a dummy category record as dictionary.""" + return {"token": "49e00f215a71612d94ea3bea48a93402", "name": "animal", "description": ""} + + +@pytest.fixture(scope="module") +def category_json(category_dict) -> Generator[str, Any, None]: + """Return a file path of dummy category record.""" + with tempfile.NamedTemporaryFile(suffix=".json", delete=False) as f: + save_json([category_dict], f.name) + yield f.name + + +# === EgoPose === +@pytest.fixture(scope="module") +def ego_pose_dict() -> dict: + """Return a dummy ego pose record as dictionary.""" + return { + "token": "d6779d73ac9c5a1f3f372aa182bc8158", + "translation": [1.0, 1.0, 1.0], + "rotation": [1.0, 0.0, 0.0, 0.0], + "timestamp": 1603452042983183, + } + + +@pytest.fixture(scope="module") +def ego_pose_json(ego_pose_dict) -> Generator[str, Any, None]: + """Return a file path of dummy ego pose record.""" + with tempfile.NamedTemporaryFile(suffix=".json", delete=False) as f: + save_json([ego_pose_dict], f.name) + yield f.name + + +# === Instance === +@pytest.fixture(scope="module") +def instance_dict() -> dict: + """Return a dummy instance record as dictionary.""" + return { + "token": "77452a485b1986e52b46a2e75349c767", + "category_token": "fe3f2abcbd5c2f8a23a0b3b2dd57f999", + "instance_name": "", + "nbr_annotations": 88, + "first_annotation_token": "f1cf0a8729de7b30742f1e55c2926ea2", + "last_annotation_token": "ad79c1b987cb82a113d1e506a249f98b", + } + + +@pytest.fixture(scope="module") +def instance_json(instance_dict) -> dict: + """Return a file path of dummy instance record.""" + with tempfile.NamedTemporaryFile(suffix=".json", delete=False) as f: + save_json([instance_dict], f.name) + yield f.name + + +# === Log === +@pytest.fixture(scope="module") +def log_dict() -> dict: + """Return a dummy log record as dictionary.""" + return { + "token": "daacef1242fcfba3bba54c81ee684bba", + "logfile": "", + "vehicle": "xx1", + "data_captured": "", + "location": "lidar_cuboid_odaiba_2hz", + } + + +@pytest.fixture(scope="module") +def log_json(log_dict) -> Generator[str, Any, None]: + """Return a file path of dummy log record.""" + with tempfile.NamedTemporaryFile(suffix=".json", delete=False) as f: + save_json([log_dict], f.name) + yield f.name + + +# === Map === +@pytest.fixture(scope="module") +def map_dict() -> dict: + """Return a dummy map record as dictionary.""" + return { + "token": "134e917e0c5404184ff04997da7b7e79", + "log_tokens": ["daacef1242fcfba3bba54c81ee684bba"], + "category": "", + "filename": "", + } + + +@pytest.fixture(scope="module") +def map_json(map_dict) -> Generator[str, Any, None]: + """Return a file path of dummy map record.""" + with tempfile.NamedTemporaryFile(suffix=".json", delete=False) as f: + save_json([map_dict], f.name) + yield f.name + + +# === SampleAnnotation === +@pytest.fixture(scope="module") +def sample_annotation_dict() -> dict: + """Return a dummy sample annotation record as dictionary.""" + return { + "token": "f1cf0a8729de7b30742f1e55c2926ea2", + "sample_token": "6026254f0d08f8001755d222_0000", + "instance_token": "77452a485b1986e52b46a2e75349c767", + "attribute_tokens": ["d3262a477673e1306db1791203be81d4"], + "visibility_token": "1", + "translation": [1.0, 1.0, 1.0], + "size": [1.0, 1.0, 1.0], + "rotation": [1.0, 0.0, 0.0, 0.0], + "num_lidar_pts": 3022, + "num_radar_pts": 0, + "next": "7b0ae1dae7531b7b917f403cb22259e6", + "prev": "", + } + + +@pytest.fixture(scope="module") +def sample_annotation_json(sample_annotation_dict) -> Generator[str, Any, None]: + """Return a file path of dummy sample annotation record.""" + with tempfile.NamedTemporaryFile(suffix=".json", delete=False) as f: + save_json([sample_annotation_dict], f.name) + yield f.name + + +# === Sample === +@pytest.fixture(scope="module") +def sample_dict() -> dict: + """Return a dummy sample record as dictionary.""" + return { + "token": "6026254f0d08f8001755d222_0000", + "timestamp": 1603452043175691, + "scene_token": "6026254f0d08f8001755d222", + "next": "6026254f0d08f8001755d222_0001", + "prev": "", + } + + +@pytest.fixture(scope="module") +def sample_json(sample_dict) -> Generator[str, Any, None]: + """Return a file path of dummy sample record.""" + with tempfile.NamedTemporaryFile(suffix=".json", delete=False) as f: + save_json([sample_dict], f.name) + yield f.name + + +# === SampleData === +@pytest.fixture(scope="module") +def sample_data_dict() -> dict: + """Return a dummy sample data record as dictionary.""" + return { + "token": "df2bee5733d8607e49bf792fac3014a3", + "sample_token": "6026254f0d08f8001755d222_0000", + "ego_pose_token": "d6779d73ac9c5a1f3f372aa182bc8158", + "calibrated_sensor_token": "0c434d5a27ef0404331549435b9861e4", + "filename": "data/camera/0.jpg", + "fileformat": "jpg", + "width": 1440, + "height": 1080, + "timestamp": 1603452042983183, + "is_key_frame": False, + "next": "efe096cc01a610af846c29aaf4decc9a", + "prev": "", + } + + +@pytest.fixture(scope="module") +def sample_data_json(sample_data_dict) -> Generator[str, Any, None]: + """Return a file path of dummy sample data record.""" + with tempfile.NamedTemporaryFile(suffix=".json", delete=False) as f: + save_json([sample_data_dict], f.name) + yield f.name + + +# === Scene === +@pytest.fixture(scope="module") +def scene_dict() -> dict: + """Return a dummy scene record as dictionary.""" + return { + "token": "6026254f0d08f8001755d222", + "name": "test", + "description": "", + "log_token": "daacef1242fcfba3bba54c81ee684bba", + "nbr_samples": 88, + "first_sample_token": "6026254f0d08f8001755d222_0000", + "last_sample_token": "6026254f0d08f8001755d222_0000", + } + + +@pytest.fixture(scope="module") +def scene_json(scene_dict) -> Generator[str, Any, None]: + """Return a file path of dummy scene record.""" + with tempfile.NamedTemporaryFile(suffix=".json", delete=False) as f: + save_json([scene_dict], f.name) + yield f.name + + +# === Sensor === +@pytest.fixture(scope="module") +def sensor_dict() -> dict: + """Return a dummy sensor record as dictionary.""" + return { + "token": "68d53dc0e128547e4d92c47de63742af", + "channel": "LIDAR_CONCAT", + "modality": "lidar", + } + + +@pytest.fixture(scope="module") +def sensor_json(sensor_dict) -> Generator[str, Any, None]: + """Return a file path of dummy sensor record.""" + with tempfile.NamedTemporaryFile(suffix=".json", delete=False) as f: + save_json([sensor_dict], f.name) + yield f.name + + +# === Visibility === +@pytest.fixture(scope="module") +def visibility_dict() -> dict: + """Return a dummy visibility record as dictionary.""" + return { + "description": "visibility of whole object is between 0 and 40%", + "token": "1", + "level": "v0-40", + } + + +@pytest.fixture(scope="module") +def visibility_json(visibility_dict) -> Generator[str, Any, None]: + """Return a file path of dummy visibility record.""" + with tempfile.NamedTemporaryFile(suffix=".json", delete=False) as f: + save_json([visibility_dict], f.name) + yield f.name + + +# === ObjectAnn === +@pytest.fixture(scope="module") +def object_ann_dict() -> dict: + """Return a dummy object ann as dictionary.""" + return { + "token": "4230e00708fb3f404d246ea97716f848", + "sample_data_token": "a1d3257e11ec9d4a587ea7053b33f1c1", + "instance_token": "8f37d145617ec022386982a2b43f1539", + "category_token": "7864884179fb37bf9e973016b13a332c", + "attribute_tokens": [], + "bbox": [0, 408.0529355733727, 1920, 728.1832152454293], + "mask": {"size": [1920, 1280], "counts": "UFBQWzI='"}, + } + + +@pytest.fixture(scope="module") +def object_ann_json(object_ann_dict) -> Generator[str, Any, None]: + """Return a file path of dummy object ann record.""" + with tempfile.NamedTemporaryFile(suffix=".json", delete=False) as f: + save_json([object_ann_dict], f.name) + yield f.name + + +# === SurfaceAnn === +@pytest.fixture(scope="module") +def surface_ann_dict() -> dict: + """Return a dummy surface ann as dictionary.""" + return { + "token": "4230e00708fb3f404d246ea97716f848", + "sample_data_token": "a1d3257e11ec9d4a587ea7053b33f1c1", + "category_token": "7864884179fb37bf9e973016b13a332c", + "mask": {"size": [1920, 1280], "counts": "UFBQWzI='"}, + } + + +@pytest.fixture(scope="module") +def surface_ann_json(surface_ann_dict) -> Generator[str, Any, None]: + """Return a file path of dummy surface ann record.""" + with tempfile.NamedTemporaryFile(suffix=".json", delete=False) as f: + save_json([surface_ann_dict], f.name) + yield f.name diff --git a/tests/schema/tables/test_attribute_table.py b/tests/schema/tables/test_attribute_table.py new file mode 100644 index 0000000..22816de --- /dev/null +++ b/tests/schema/tables/test_attribute_table.py @@ -0,0 +1,11 @@ +from t4_devkit.schema import Attribute + + +def test_attribute_json(attribute_json) -> None: + """Test loading attribute from a json file.""" + _ = Attribute.from_json(attribute_json) + + +def test_attribute(attribute_dict) -> None: + """Test loading attribute from a dictionary.""" + _ = Attribute.from_dict(attribute_dict) diff --git a/tests/schema/tables/test_calibrated_sensor_table.py b/tests/schema/tables/test_calibrated_sensor_table.py new file mode 100644 index 0000000..5837fb8 --- /dev/null +++ b/tests/schema/tables/test_calibrated_sensor_table.py @@ -0,0 +1,11 @@ +from t4_devkit.schema import CalibratedSensor + + +def test_calibrated_sensor_json(calibrated_sensor_json) -> None: + """Test loading calibrated sensor from a json file.""" + _ = CalibratedSensor.from_json(calibrated_sensor_json) + + +def test_calibrated_sensor(calibrated_sensor_dict) -> None: + """Test loading calibrated sensor from a dictionary.""" + _ = CalibratedSensor.from_dict(calibrated_sensor_dict) diff --git a/tests/schema/tables/test_category_table.py b/tests/schema/tables/test_category_table.py new file mode 100644 index 0000000..a75c7e1 --- /dev/null +++ b/tests/schema/tables/test_category_table.py @@ -0,0 +1,11 @@ +from t4_devkit.schema import Category + + +def test_category_json(category_json) -> None: + """Test loading category from a json file.""" + _ = Category.from_json(category_json) + + +def test_category(category_dict) -> None: + """Test loading sample data from a dictionary.""" + _ = Category.from_dict(category_dict) diff --git a/tests/schema/tables/test_ego_pose_table.py b/tests/schema/tables/test_ego_pose_table.py new file mode 100644 index 0000000..ab1d510 --- /dev/null +++ b/tests/schema/tables/test_ego_pose_table.py @@ -0,0 +1,11 @@ +from t4_devkit.schema import EgoPose + + +def test_ego_pose_json(ego_pose_json) -> None: + """Test loading ego pose from a json file.""" + _ = EgoPose.from_json(ego_pose_json) + + +def test_ego_pose(ego_pose_dict) -> None: + """Test loading ego pose from a dictionary.""" + _ = EgoPose.from_dict(ego_pose_dict) diff --git a/tests/schema/tables/test_instance_table.py b/tests/schema/tables/test_instance_table.py new file mode 100644 index 0000000..202c56d --- /dev/null +++ b/tests/schema/tables/test_instance_table.py @@ -0,0 +1,11 @@ +from t4_devkit.schema import Instance + + +def test_instance_json(instance_json) -> None: + """Test loading instance from a json file.""" + _ = Instance.from_json(instance_json) + + +def test_instance(instance_dict) -> None: + """Test loading instance from a dictionary.""" + _ = Instance.from_dict(instance_dict) diff --git a/tests/schema/tables/test_log_table.py b/tests/schema/tables/test_log_table.py new file mode 100644 index 0000000..98351cc --- /dev/null +++ b/tests/schema/tables/test_log_table.py @@ -0,0 +1,11 @@ +from t4_devkit.schema import Log + + +def test_log_json(log_json) -> None: + """Test loading log from a json file.""" + _ = Log.from_json(log_json) + + +def test_log(log_dict) -> None: + """Test loading log from a dictionary.""" + _ = Log.from_dict(log_dict) diff --git a/tests/schema/tables/test_map_table.py b/tests/schema/tables/test_map_table.py new file mode 100644 index 0000000..1900a53 --- /dev/null +++ b/tests/schema/tables/test_map_table.py @@ -0,0 +1,11 @@ +from t4_devkit.schema import Map + + +def test_map_json(map_json) -> None: + """Test loading map from a json file.""" + _ = Map.from_json(map_json) + + +def test_map(map_dict) -> None: + """Test loading map from a dictionary.""" + _ = Map.from_dict(map_dict) diff --git a/tests/schema/tables/test_object_ann_table.py b/tests/schema/tables/test_object_ann_table.py new file mode 100644 index 0000000..2965f35 --- /dev/null +++ b/tests/schema/tables/test_object_ann_table.py @@ -0,0 +1,11 @@ +from t4_devkit.schema import ObjectAnn + + +def test_object_ann_json(object_ann_json) -> None: + """Test loading object ann from a json file.""" + _ = ObjectAnn.from_json(object_ann_json) + + +def test_object_ann(object_ann_dict) -> None: + """Test loading object ann from a dictionary.""" + _ = ObjectAnn.from_dict(object_ann_dict) diff --git a/tests/schema/tables/test_sample_annotation_table.py b/tests/schema/tables/test_sample_annotation_table.py new file mode 100644 index 0000000..49ce3cb --- /dev/null +++ b/tests/schema/tables/test_sample_annotation_table.py @@ -0,0 +1,11 @@ +from t4_devkit.schema import SampleAnnotation + + +def test_sample_annotation_json(sample_annotation_json) -> None: + """Test loading sample annotation from a json file.""" + _ = SampleAnnotation.from_json(sample_annotation_json) + + +def test_sample_annotation(sample_annotation_dict) -> None: + """Test loading sample annotation from a dictionary.""" + _ = SampleAnnotation.from_dict(sample_annotation_dict) diff --git a/tests/schema/tables/test_sample_data_table.py b/tests/schema/tables/test_sample_data_table.py index ff38685..b213506 100644 --- a/tests/schema/tables/test_sample_data_table.py +++ b/tests/schema/tables/test_sample_data_table.py @@ -1,4 +1,4 @@ -from t4_devkit.schema import FileFormat +from t4_devkit.schema import FileFormat, SampleData def test_fileformat() -> None: @@ -22,3 +22,13 @@ def test_fileformat() -> None: # check as_ext() returns .value assert member.as_ext() == f".{value}" + + +def test_sample_data_json(sample_data_json) -> None: + """Test loading sample data from a json file.""" + _ = SampleData.from_json(sample_data_json) + + +def test_sample_data(sample_data_dict) -> None: + """Test loading sample data from a dictionary.""" + _ = SampleData.from_dict(sample_data_dict) diff --git a/tests/schema/tables/test_sample_table.py b/tests/schema/tables/test_sample_table.py new file mode 100644 index 0000000..2db4675 --- /dev/null +++ b/tests/schema/tables/test_sample_table.py @@ -0,0 +1,11 @@ +from t4_devkit.schema import Sample + + +def test_sample_json(sample_json) -> None: + """Test loading sample from a json file.""" + _ = Sample.from_json(sample_json) + + +def test_sample(sample_dict) -> None: + """Test loading sample from a dictionary.""" + _ = Sample.from_dict(sample_dict) diff --git a/tests/schema/tables/test_sensor_table.py b/tests/schema/tables/test_sensor_table.py index e9b2287..0b6674d 100644 --- a/tests/schema/tables/test_sensor_table.py +++ b/tests/schema/tables/test_sensor_table.py @@ -1,4 +1,4 @@ -from t4_devkit.schema import SensorModality +from t4_devkit.schema import Sensor, SensorModality def test_sensor_modality() -> None: @@ -13,3 +13,13 @@ def test_sensor_modality() -> None: # check each member can construct for value in modalities: _ = SensorModality(value) + + +def test_sensor_json(sensor_json) -> None: + """Test loading sensor from a json file.""" + _ = Sensor.from_json(sensor_json) + + +def test_sensor(sensor_dict) -> None: + """Test loading sensor from a dictionary.""" + _ = Sensor.from_dict(sensor_dict) diff --git a/tests/schema/tables/test_surface_ann_table.py b/tests/schema/tables/test_surface_ann_table.py new file mode 100644 index 0000000..62ddcde --- /dev/null +++ b/tests/schema/tables/test_surface_ann_table.py @@ -0,0 +1,11 @@ +from t4_devkit.schema import SurfaceAnn + + +def test_surface_ann_json(surface_ann_json) -> None: + """Test loading surface ann from a json file.""" + _ = SurfaceAnn.from_json(surface_ann_json) + + +def test_surface_ann(surface_ann_dict) -> None: + """Test loading surface ann from a dictionary.""" + _ = SurfaceAnn.from_dict(surface_ann_dict) diff --git a/tests/schema/tables/test_visibility_schema.py b/tests/schema/tables/test_visibility_table.py similarity index 68% rename from tests/schema/tables/test_visibility_schema.py rename to tests/schema/tables/test_visibility_table.py index c7f05f4..21aa138 100644 --- a/tests/schema/tables/test_visibility_schema.py +++ b/tests/schema/tables/test_visibility_table.py @@ -1,4 +1,4 @@ -from t4_devkit.schema import VisibilityLevel +from t4_devkit.schema import Visibility, VisibilityLevel def test_visibility_level() -> None: @@ -24,3 +24,13 @@ def test_visibility_level_deprecated() -> None: level = VisibilityLevel.from_value(value) expect_level = VisibilityLevel(expect) assert level == expect_level + + +def test_visibility_json(visibility_json) -> None: + """Test loading visibility from a json file.""" + _ = Visibility.from_json(visibility_json) + + +def test_visibility(visibility_dict) -> None: + """Test loading visibility from a dictionary.""" + _ = Visibility.from_dict(visibility_dict) diff --git a/tests/schema/test_schema_builder.py b/tests/schema/test_schema_builder.py new file mode 100644 index 0000000..f963b3e --- /dev/null +++ b/tests/schema/test_schema_builder.py @@ -0,0 +1,71 @@ +from t4_devkit.schema import SchemaName, build_schema + + +def test_build_attribute(attribute_json) -> None: + """Test building attribute.""" + _ = build_schema(SchemaName.ATTRIBUTE, attribute_json) + + +def test_build_calibrated_sensor(calibrated_sensor_json) -> None: + """Test building calibrated sensor.""" + _ = build_schema(SchemaName.CALIBRATED_SENSOR, calibrated_sensor_json) + + +def test_build_category(category_json) -> None: + """Test building category.""" + _ = build_schema(SchemaName.CATEGORY, category_json) + + +def test_build_ego_pose(ego_pose_json) -> None: + """Test building ego pose.""" + _ = build_schema(SchemaName.EGO_POSE, ego_pose_json) + + +def test_build_instance(instance_json) -> None: + """Test building instance.""" + _ = build_schema(SchemaName.INSTANCE, instance_json) + + +def test_build_log(log_json) -> None: + """Test building log.""" + _ = build_schema(SchemaName.LOG, log_json) + + +def test_build_map(map_json) -> None: + """Test building map.""" + _ = build_schema(SchemaName.MAP, map_json) + + +def test_build_object_ann(object_ann_json) -> None: + """Test building object ann.""" + _ = build_schema(SchemaName.OBJECT_ANN, object_ann_json) + + +def test_build_sample_annotation(sample_annotation_json) -> None: + """Test building sample annotation.""" + _ = build_schema(SchemaName.SAMPLE_ANNOTATION, sample_annotation_json) + + +def test_build_sample_data(sample_data_json) -> None: + """Test building sample data.""" + _ = build_schema(SchemaName.SAMPLE_DATA, sample_data_json) + + +def test_build_sample(sample_json) -> None: + """Test building sample.""" + _ = build_schema(SchemaName.SAMPLE, sample_json) + + +def test_build_sensor(sensor_json) -> None: + """Test building sensor.""" + _ = build_schema(SchemaName.SENSOR, sensor_json) + + +def test_build_surface_ann(surface_ann_json) -> None: + """Test building surface ann.""" + _ = build_schema(SchemaName.SURFACE_ANN, surface_ann_json) + + +def test_build_visibility(visibility_json) -> None: + """Test building visibility.""" + _ = build_schema(SchemaName.VISIBILITY, visibility_json)