Exemplo n.º 1
0
 def setUp(self):
     self.test_db = SqliteDatabase(':memory:')
     self.test_db.bind(MODELS)
     self.test_db.connect()
     self.test_db.create_tables(MODELS)
     self._gateway_api = mock.Mock(GatewayApi)
     self._gateway_api.get_sensor_temperature_status.return_value = 0.0
     self._pump_valve_controller = mock.Mock(PumpValveController)
     SetUpTestInjections(gateway_api=self._gateway_api)
     self._thermostat_group = ThermostatGroup.create(
         number=0,
         name='thermostat group',
         on=True,
         threshold_temperature=10.0,
         sensor=Sensor.create(number=1),
         mode='heating')
Exemplo n.º 2
0
 def setUp(self):
     self.test_db = SqliteDatabase(':memory:')
     self.test_db.bind(MODELS)
     self.test_db.connect()
     self.test_db.create_tables(MODELS)
     self._gateway_api = mock.Mock(GatewayApi)
     self._gateway_api.get_timezone.return_value = 'Europe/Brussels'
     self._gateway_api.get_sensor_temperature_status.return_value = 10.0
     output_controller = mock.Mock(OutputController)
     output_controller.get_output_status.return_value = OutputStateDTO(id=0, status=False)
     SetUpTestInjections(gateway_api=self._gateway_api,
                         output_controller=output_controller,
                         pubsub=mock.Mock())
     self._thermostat_controller = ThermostatControllerGateway()
     SetUpTestInjections(thermostat_controller=self._thermostat_controller)
     self._thermostat_group = ThermostatGroup.create(number=0,
                                                     name='thermostat group',
                                                     on=True,
                                                     threshold_temperature=10.0,
                                                     sensor=Sensor.create(number=1),
                                                     mode='heating')