Coverage for python/lum/clu/odin/tests/test_compact_deserialization.py: 100%
10 statements
« prev ^ index » next coverage.py v7.6.7, created at 2024-11-17 18:41 +0000
« prev ^ index » next coverage.py v7.6.7, created at 2024-11-17 18:41 +0000
1from lum.clu.odin.serialization import OdinJsonSerializer
2from .utils import test_cases
3import pytest
4import typing
6def test_load_compact_json():
7 """Test case for OdinJsonSerializer.from_compact_mentions_json()"""
8 for tc in test_cases:
9 compact_json: dict[str, typing.Any] = tc.json_dict
10 expected = len(compact_json.get("mentions", []))
11 mentions = OdinJsonSerializer.from_compact_mentions_json(compact_json)
12 #print(f"Expected to load {expected} mentions from {tc.name}. Found {len(mentions)}\n")
13 assert len(mentions) == expected, f"Expected to load {expected} mentions from {tc.name}, but {len(mentions)} found"