Coverage for python/lum/clu/odin/tests/utils.py: 100%
12 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 pydantic import BaseModel
2import json
3import os
4import typing
6# Test utilities
8class TestCaseMentionsData(BaseModel):
9 name: str
10 path: str
12 @property
13 def json_dict(self) -> dict[str, typing.Any]:
14 with open(self.path, "r") as infile:
15 return json.load(infile)
17test_cases = [
18 TestCaseMentionsData(
19 name="old-mentions",
20 path=os.path.join(
21 os.path.dirname(os.path.realpath(__file__)),
22 "data",
23 "mentions-old.json"
24 )
25 ),
26 TestCaseMentionsData(
27 name="overlapping-mentions",
28 path=os.path.join(
29 os.path.dirname(os.path.realpath(__file__)),
30 "data",
31 "overlapping-mentions.json"
32 )
33 )
34]