'Test for successfully setting up the forecast.io platform.'

@requests_mock.Mocker()
@patch('forecastio.api.get_forecast', wraps=forecastio.api.get_forecast)
def test_setup(self, mock_req, mock_get_forecast):

    uri = 'https://api.(darksky.net|forecast.io)\\/forecast\\/(\\w+)\\/(-?\\d+\\.?\\d*),(-?\\d+\\.?\\d*)'
    mock_req.get(re.compile(uri), text=load_fixture('darksky.json'))
    darksky.setup_platform(self.hass, self.config, self.add_entities)
    self.assertTrue(mock_get_forecast.called)
    self.assertEqual(mock_get_forecast.call_count, 1)
    self.assertEqual(len(self.entities), 7)
