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

1from pydantic import BaseModel 

2import json 

3import os 

4import typing 

5 

6# Test utilities 

7 

8class TestCaseMentionsData(BaseModel): 

9 name: str 

10 path: str 

11 

12 @property 

13 def json_dict(self) -> dict[str, typing.Any]: 

14 with open(self.path, "r") as infile: 

15 return json.load(infile) 

16 

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]