# pylint: disable=missing-docstring
import logging
+import os
import unittest
import mock
from functest.core import testcase
from functest.opnfv_tests.openstack.tempest import tempest
from functest.opnfv_tests.openstack.tempest import conf_utils
-from functest.utils.constants import CONST
from snaps.openstack.os_credentials import OSCreds
def _test_gen_tl_mode_default(self, mode):
self.tempestcommon.mode = mode
if self.tempestcommon.mode == 'smoke':
- testr_mode = "smoke"
+ testr_mode = r"'tempest\.(api|scenario).*\[.*\bsmoke\b.*\]'"
elif self.tempestcommon.mode == 'full':
- testr_mode = ""
+ testr_mode = r"'^tempest\.'"
else:
testr_mode = 'tempest.api.' + self.tempestcommon.mode
conf_utils.TEMPEST_RAW_LIST = 'raw_list'
mock.patch.object(self.tempestcommon, 'read_file',
return_value=['test1', 'test2']):
conf_utils.TEMPEST_BLACKLIST = Exception
- CONST.__setattr__('INSTALLER_TYPE', 'installer_type')
- CONST.__setattr__('DEPLOY_SCENARIO', 'deploy_scenario')
+ os.environ['INSTALLER_TYPE'] = 'installer_type'
+ os.environ['DEPLOY_SCENARIO'] = 'deploy_scenario'
self.tempestcommon.apply_tempest_blacklist()
obj = mock_open()
obj.write.assert_any_call('test1\n')
return_value=['test1', 'test2']), \
mock.patch('functest.opnfv_tests.openstack.tempest.tempest.'
'yaml.safe_load', return_value=item_dict):
- CONST.__setattr__('INSTALLER_TYPE', 'installer_type')
- CONST.__setattr__('DEPLOY_SCENARIO', 'deploy_scenario')
+ os.environ['INSTALLER_TYPE'] = 'installer_type'
+ os.environ['DEPLOY_SCENARIO'] = 'deploy_scenario'
self.tempestcommon.apply_tempest_blacklist()
obj = mock_open()
obj.write.assert_any_call('test1\n')