Coverage for source/model/model_blue_prints/mock_blue_print.py: 86%
7 statements
« prev ^ index » next coverage.py v7.8.0, created at 2025-05-30 15:13 +0000
« prev ^ index » next coverage.py v7.8.0, created at 2025-05-30 15:13 +0000
1# model/model_blue_prints/mock_blue_print.py
3from tensorflow.keras import Model
5from .base_blue_print import BaseBluePrint
7class MockBluePrint(BaseBluePrint):
8 """
9 Mock implementation of the BaseBluePrint for testing purposes.
11 This class provides a simple implementation that returns a pre-configured model
12 rather than constructing one. It's primarily used in tests to isolate the model
13 creation logic from other components being tested.
14 """
16 def __init__(self, model_to_be_returned: Model) -> None:
17 """
18 Initialize the mock blueprint with a pre-configured model.
20 Parameters:
21 model_to_be_returned (Model): Keras model instance that will be returned
22 when instantiate_model is called.
23 """
25 self.__model_to_be_returned: Model = model_to_be_returned
27 def instantiate_model(self, **kwargs) -> Model:
28 """
29 Returns the pre-configured model regardless of input parameters.
31 This method implements the abstract method from BaseBluePrint but
32 ignores the input parameters and simply returns the model provided
33 at initialization.
35 Parameters:
36 **kwargs: Variable keyword arguments (ignored).
38 Returns:
39 Model: The pre-configured Keras model provided at initialization.
40 """
42 return self.__model_to_be_returned