1 # Copyright (c) 2018 Intel Corporation
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
18 from oslo_config import cfg
19 from oslotest import base
25 @six.add_metaclass(abc.ABCMeta)
26 class BaseFunctionalTestCase(base.BaseTestCase):
27 """Base class for functional tests."""
30 super(BaseFunctionalTestCase, self).setUp()
32 def config(self, **kw):
33 """Override some configuration values.
35 The keyword arguments are the names of configuration options to
36 override and their values.
38 If a group argument is supplied, the overrides are applied to
39 the specified configuration option group.
41 All overrides are automatically cleared at the end of the current
42 test by the fixtures cleanup process.
44 group = kw.pop('group', None)
45 for k, v in kw.items():
46 CONF.set_override(k, v, group)