Skip to content

Commit 9ba7aa2

Browse files
changes ControllerInterface to ControllerBase
1 parent 54c8ce8 commit 9ba7aa2

File tree

6 files changed

+14
-14
lines changed

6 files changed

+14
-14
lines changed

src/controllers/environment.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
from src.controllers.interface import (
2-
ControllerInterface,
2+
ControllerBase,
33
controller_exception_handler,
44
)
55
from src.views.environment import EnvironmentSimulation
66
from src.models.environment import EnvironmentModel
77
from src.services.environment import EnvironmentService
88

99

10-
class EnvironmentController(ControllerInterface):
10+
class EnvironmentController(ControllerBase):
1111
"""
1212
Controller for the Environment model.
1313

src/controllers/flight.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from src.controllers.interface import (
2-
ControllerInterface,
2+
ControllerBase,
33
controller_exception_handler,
44
)
55
from src.views.flight import FlightSimulation
@@ -9,7 +9,7 @@
99
from src.services.flight import FlightService
1010

1111

12-
class FlightController(ControllerInterface):
12+
class FlightController(ControllerBase):
1313
"""
1414
Controller for the Flight model.
1515

src/controllers/interface.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ async def wrapper(self, *args, **kwargs):
3636
return wrapper
3737

3838

39-
class ControllerInterface:
39+
class ControllerBase:
4040

4141
def __init__(self, models: List[ApiBaseModel]):
4242
self._initialized_models = {}

src/controllers/motor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
from src.controllers.interface import (
2-
ControllerInterface,
2+
ControllerBase,
33
controller_exception_handler,
44
)
55
from src.views.motor import MotorSimulation
66
from src.models.motor import MotorModel
77
from src.services.motor import MotorService
88

99

10-
class MotorController(ControllerInterface):
10+
class MotorController(ControllerBase):
1111
"""
1212
Controller for the motor model.
1313

src/controllers/rocket.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
from src.controllers.interface import (
2-
ControllerInterface,
2+
ControllerBase,
33
controller_exception_handler,
44
)
55
from src.views.rocket import RocketSimulation
66
from src.models.rocket import RocketModel
77
from src.services.rocket import RocketService
88

99

10-
class RocketController(ControllerInterface):
10+
class RocketController(ControllerBase):
1111
"""
1212
Controller for the Rocket model.
1313

tests/unit/test_controllers/test_controller_interface.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from pymongo.errors import PyMongoError
44
from fastapi import HTTPException, status
55
from src.controllers.interface import (
6-
ControllerInterface,
6+
ControllerBase,
77
controller_exception_handler,
88
)
99

@@ -22,7 +22,7 @@ def stub_model():
2222

2323
@pytest.fixture
2424
def stub_controller(stub_model):
25-
return ControllerInterface([stub_model])
25+
return ControllerBase([stub_model])
2626

2727

2828
@pytest.mark.asyncio
@@ -97,10 +97,10 @@ async def method(self, model, *args, **kwargs):
9797

9898
def test_controller_interface_init(stub_model):
9999
with patch(
100-
'src.controllers.interface.ControllerInterface._generate_method'
100+
'src.controllers.interface.ControllerBase._generate_method'
101101
) as mock_gen:
102102
mock_gen.return_value = lambda *args, **kwargs: True
103-
stub_controller = ControllerInterface([stub_model])
103+
stub_controller = ControllerBase([stub_model])
104104
assert stub_controller._initialized_models == {
105105
'test_model': stub_model
106106
}
@@ -120,7 +120,7 @@ async def test_controller_interface_generate_available_method(
120120
):
121121
with patch('src.controllers.interface.RepositoryInterface') as mock_repo:
122122
with patch(
123-
'src.controllers.interface.ControllerInterface._get_model'
123+
'src.controllers.interface.ControllerBase._get_model'
124124
) as mock_get:
125125
mock_get.return_value = stub_model
126126
method = stub_controller._generate_method('get', stub_model)

0 commit comments

Comments
 (0)