Exemple #1
0
 def test_should_be_on_currently_on(self, mock_turn_on, mock_turn_off,
                                    mock_is_on, mock_switch):
     section = Engine(CFG_FILE)
     section.minutes_to_next_event = 10
     section.req_energy = 100
     section.heater_power = 200
     mock_is_on.return_value = True
     switch_should_be_on = section.should_be_on()
     self.assertTrue(switch_should_be_on)
Exemple #2
0
 def test_find_required_energy_engine_3(self):
     section = Engine(CFG_FILE)
     weather = {'temperature': 6.5}
     section.weather = weather
     energy = section.find_req_energy()
     self.assertEqual(energy, 500)