'Ensure the OSAPI server responds to calls sensibly.'

@mock.patch('nova.objects.Service.get_by_host_and_binary')
@mock.patch('nova.objects.Service.create')
def test_responds_to_version(self, mock_service_create, mock_get):

    self.useFixture(fixtures.OutputStreamCapture())
    self.useFixture(fixtures.StandardLogging())
    self.useFixture(conf_fixture.ConfFixture())
    self.useFixture(fixtures.RPCFixture('nova.test'))
    api = self.useFixture(fixtures.OSAPIFixture()).api
    resp = api.api_request('/', strip_version=True)
    self.assertEqual(200, resp.status_code, resp.content)
    resp = api.api_request('/foo')
    self.assertEqual(404, resp.status_code, resp.content)
