'Call a rest command with post form data.'

def test_rest_command_form_data(self, aioclient_mock):

    data = {'payload': 'test'}
    self.config[rc.DOMAIN]['post_test'].update(data)
    with assert_setup_component(4):
        setup_component(self.hass, rc.DOMAIN, self.config)
    aioclient_mock.post(self.url, content='success')
    self.hass.services.call(rc.DOMAIN, 'post_test', {})
    self.hass.block_till_done()
    assert (len(aioclient_mock.mock_calls) == 1)
    assert (aioclient_mock.mock_calls[0][2] == 'test')
