def test_set_away_mode_bad_attr(self): """Test setting the away mode without required attribute.""" state = self.hass.states.get(ENTITY_WATER_HEATER) assert 'off' == state.attributes.get('away_mode') common.set_away_mode(self.hass, None, ENTITY_WATER_HEATER) self.hass.block_till_done() assert 'off' == state.attributes.get('away_mode')
def test_set_away_mode_bad_attr(self): """Test setting the away mode without required attribute.""" state = self.hass.states.get(ENTITY_WATER_HEATER) assert 'off' == state.attributes.get('away_mode') common.set_away_mode(self.hass, None, ENTITY_WATER_HEATER) self.hass.block_till_done() assert 'off' == state.attributes.get('away_mode')
def test_set_away_mode_bad_attr(self): """Test setting the away mode without required attribute.""" state = self.hass.states.get(ENTITY_WATER_HEATER) assert "off" == state.attributes.get("away_mode") with pytest.raises(vol.Invalid): common.set_away_mode(self.hass, None, ENTITY_WATER_HEATER) self.hass.block_till_done() assert "off" == state.attributes.get("away_mode")
def test_set_away_mode_on(self): """Test setting the away mode on/true.""" common.set_away_mode(self.hass, True, ENTITY_WATER_HEATER) self.hass.block_till_done() state = self.hass.states.get(ENTITY_WATER_HEATER) assert "on" == state.attributes.get("away_mode")
def test_set_away_mode_off(self): """Test setting the away mode off/false.""" common.set_away_mode(self.hass, False, ENTITY_WATER_HEATER_CELSIUS) self.hass.block_till_done() state = self.hass.states.get(ENTITY_WATER_HEATER_CELSIUS) assert "off" == state.attributes.get("away_mode")
def test_set_away_mode_off(self): """Test setting the away mode off/false.""" common.set_away_mode(self.hass, False, ENTITY_WATER_HEATER_CELSIUS) self.hass.block_till_done() state = self.hass.states.get(ENTITY_WATER_HEATER_CELSIUS) assert 'off' == state.attributes.get('away_mode')
def test_set_away_mode_on(self): """Test setting the away mode on/true.""" common.set_away_mode(self.hass, True, ENTITY_WATER_HEATER) self.hass.block_till_done() state = self.hass.states.get(ENTITY_WATER_HEATER) assert 'on' == state.attributes.get('away_mode')