'Test state logs an error when data is missing.'

@requests_mock.Mocker()
def test_when_api_data_missing(self, mock_req):

    self.setup_api(MOCK_DATA_MISSING, mock_req)
    now = datetime(1970, month=1, day=1)
    with patch('homeassistant.util.dt.now', return_value=now):
        for name in self.sensor_dict:
            sensor = self.sensor_dict[name]['sensor']
            self.fake_delay(2)
            sensor.update()
            self.assertEqual(STATE_UNKNOWN, sensor.state)
