'Test setup with valid configuration.'

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

    mock_req.get('http://localhost', status_code=200)
    self.assertTrue(setup_component(self.hass, 'sensor', {'sensor': {'platform': 'rest', 'resource': 'http://localhost', 'method': 'GET', 'value_template': '{{    value_json.key    }}', 'name': 'foo', 'unit_of_measurement': 'MB', 'verify_ssl': 'true', 'authentication': 'basic', 'username': 'my    username', 'password': 'my    password', 'headers': {'Accept': 'application/json'}}}))
    self.assertEqual(2, mock_req.call_count)
    assert_setup_component(1, 'sensor')
