blob: 6817eaade6d38272a001bebbe2e23c9068d93d48 [file] [log] [blame]
Andrew Kerrfcb0b682016-04-01 16:01:34 -04001#
2# Licensed under the Apache License, Version 2.0 (the "License"); you may
3# not use this file except in compliance with the License. You may obtain
4# a copy of the License at
5#
6# http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11# License for the specific language governing permissions and limitations
12# under the License.
13
14import fixtures
15
16from tempest.services.volume.base import base_v3_client
17
18
19class APIMicroversionFixture(fixtures.Fixture):
20
21 def __init__(self, volume_microversion):
22 self.volume_microversion = volume_microversion
23
24 def _setUp(self):
25 super(APIMicroversionFixture, self)._setUp()
26 base_v3_client.VOLUME_MICROVERSION = self.volume_microversion
27 self.addCleanup(self._reset_volume_microversion)
28
29 def _reset_volume_microversion(self):
30 base_v3_client.VOLUME_MICROVERSION = None