mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 00:55:19 +00:00
Use setUpClass
instead of __init__
This commit is contained in:
parent
db35b40b51
commit
41df7eca96
@ -36,17 +36,23 @@ class BaseRestCherryPyTest(BaseCherryPyTestCase):
|
||||
'''
|
||||
__opts__ = None
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(BaseRestCherryPyTest, self).__init__(*args, **kwargs)
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
master_conf = os.path.join(TMP_CONF_DIR, 'master')
|
||||
self.config = salt.config.client_config(master_conf)
|
||||
cls.config = salt.config.client_config(master_conf)
|
||||
cls.base_opts = {}
|
||||
cls.base_opts.update(cls.config)
|
||||
|
||||
def setUp(self, *args, **kwargs):
|
||||
@classmethod
|
||||
def tearDownClass(cls):
|
||||
del cls.config
|
||||
del cls.base_opts
|
||||
|
||||
def setUp(self):
|
||||
# Make a local reference to the CherryPy app so we can mock attributes.
|
||||
self.app = app
|
||||
|
||||
__opts__ = self.config.copy()
|
||||
__opts__ = self.base_opts.copy()
|
||||
__opts__.update(self.__opts__ or {
|
||||
'external_auth': {
|
||||
'auto': {
|
||||
|
Loading…
Reference in New Issue
Block a user