'Setup API with fake data.'

def setup_api(self, data, mock_req):

    resource = '{}{}{}'.format('http://', 'localhost', google_wifi.ENDPOINT)
    now = datetime(1970, month=1, day=1)
    with patch('homeassistant.util.dt.now', return_value=now):
        mock_req.get(resource, text=data, status_code=200)
        conditions = google_wifi.MONITORED_CONDITIONS.keys()
        self.api = google_wifi.GoogleWifiAPI('localhost', conditions)
    self.name = NAME
    self.sensor_dict = dict()
    for (condition, cond_list) in google_wifi.MONITORED_CONDITIONS.items():
        sensor = google_wifi.GoogleWifiSensor(self.api, self.name, condition)
        name = '{}_{}'.format(self.name, condition)
        units = cond_list[1]
        icon = cond_list[2]
        self.sensor_dict[condition] = {'sensor': sensor, 'name': name, 'units': units, 'icon': icon}
