Coverage for /opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/site-packages/hypervehicle/generator.py: 77%

13 statements  

« prev     ^ index     » next       coverage.py v7.6.4, created at 2024-10-29 02:51 +0000

1from abc import abstractmethod 

2from hypervehicle import Vehicle 

3 

4 

5class AbstractGenerator: 

6 """Abstract Generator Interface.""" 

7 

8 @abstractmethod 

9 def __init__(self, **kwargs) -> None: 

10 pass 

11 

12 @abstractmethod 

13 def create_instance(self) -> Vehicle: 

14 pass 

15 

16 

17class Generator(AbstractGenerator): 

18 """Hypervehicle Parametric Generator.""" 

19 

20 def __init__(self, **kwargs) -> None: 

21 """Initialises the generator.""" 

22 # Unpack kwargs and overwrite parameter named attributes 

23 for item in kwargs: 

24 setattr(self, item, kwargs[item])