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
« prev ^ index » next coverage.py v7.6.4, created at 2024-10-29 02:51 +0000
1from abc import abstractmethod
2from hypervehicle import Vehicle
5class AbstractGenerator:
6 """Abstract Generator Interface."""
8 @abstractmethod
9 def __init__(self, **kwargs) -> None:
10 pass
12 @abstractmethod
13 def create_instance(self) -> Vehicle:
14 pass
17class Generator(AbstractGenerator):
18 """Hypervehicle Parametric Generator."""
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])