'Test setup with valid configuration.'

def test_setup(self, aioclient_mock):

    aioclient_mock.get('http://localhost', status=200)
    assert setup_component(self.hass, 'switch', {'switch': {'platform': 'rest', 'name': 'foo', 'resource': 'http://localhost', 'body_on': 'custom    on    text', 'body_off': 'custom    off    text'}})
    assert (aioclient_mock.call_count == 1)
    assert_setup_component(1, 'switch')
