Coverage for fio_wrapper/models/material_models.py: 100%

16 statements  

« prev     ^ index     » next       coverage.py v7.3.2, created at 2023-11-16 11:50 +0100

1from typing import List 

2from pydantic import BaseModel, RootModel, Field, NaiveDatetime 

3 

4 

5class MaterialTicker(BaseModel): 

6 MaterialId: str = Field(min_length=32) 

7 CategoryName: str 

8 CategoryId: str = Field(min_length=32) 

9 Name: str 

10 Ticker: str 

11 Weight: float 

12 Volume: float 

13 UserNameSubmitted: str 

14 Timestamp: NaiveDatetime 

15 

16 

17class MaterialTickerList(RootModel): 

18 root: List[MaterialTicker] 

19 

20 def __iter__(self): 

21 return iter(self.root)