'Ensure logs register microversion if passed.
This makes sure that microversion logging actually shows up
when appropriate.'

@mock.patch('nova.api.openstack.requestlog.RequestLog._should_emit')
def test_logs_mv(self, emit):

    emit.return_value = True
    self.useFixture(fixtures.OutputStreamCapture())
    log = fixtures.StandardLogging()
    self.useFixture(log)
    self.useFixture(conf_fixture.ConfFixture())
    self.useFixture(fx.MonkeyPatch('nova.api.openstack.compute.versions.Versions.support_api_request_version', True))
    self.useFixture(fixtures.RPCFixture('nova.test'))
    api = self.useFixture(fixtures.OSAPIFixture()).api
    api.microversion = '2.25'
    resp = api.api_request('/', strip_version=True)
    content_length = resp.headers['content-length']
    log1 = ('INFO    [nova.api.openstack.requestlog]    127.0.0.1    "GET    /"    status:    200    len:    %s    microversion:    2.25    time:' % content_length)
    self.assertIn(log1, log.logger.output)
