'Test glance version set by flag is honoured.'

@mock.patch('cinder.image.glance.glanceclient.Client')
def test_glance_version_by_flag(self, _mockglanceclient):

    ctx = mock.MagicMock()
    glance.GlanceClientWrapper(ctx, 'fake_host', 9292)
    self.assertEqual('2', _mockglanceclient.call_args[0][0])
    self.flags(glance_api_version=1)
    glance.GlanceClientWrapper(ctx, 'fake_host', 9292)
    self.assertEqual('1', _mockglanceclient.call_args[0][0])
    CONF.reset()
