本文整理汇总了Python中st2tests.config.parse_args函数的典型用法代码示例。如果您正苦于以下问题:Python parse_args函数的具体用法?Python parse_args怎么用?Python parse_args使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了parse_args函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setUpClass
def setUpClass(cls):
tests_config.parse_args()
# Store original values so we can restore them in setUp
cls.old_path = os.environ.get('PATH', '')
cls.old_python_path = os.environ.get('PYTHONPATH', '')
cls.old_real_prefix = sys.real_prefix
示例2: setUpClass
def setUpClass(cls):
super(HashPartitionerTest, cls).setUpClass()
# Create TriggerTypes before creation of Rule to avoid failure. Rule requires the
# Trigger and therefore TriggerType to be created prior to rule creation.
cls.models = FixturesLoader().save_fixtures_to_db(
fixtures_pack=PACK, fixtures_dict=FIXTURES_1)
config.parse_args()
示例3: setUpClass
def setUpClass(cls):
super(FunctionalTest, cls).setUpClass()
tests_config.parse_args()
# Make sure auth is disabled
cfg.CONF.set_default('enable', False, group='auth')
# Make sure RBAC is disabled
cfg.CONF.set_override(name='enable', override=False, group='rbac')
opts = cfg.CONF.api_pecan
cfg_dict = {
'app': {
'root': opts.root,
'template_path': opts.template_path,
'modules': opts.modules,
'debug': opts.debug,
'auth_enable': opts.auth_enable,
'errors': {'__force_dict__': True}
}
}
# TODO(manas) : register action types here for now. RunnerType registration can be moved
# to posting to /runnertypes but that implies implementing POST.
runners_registrar.register_runner_types()
cls.app = load_test_app(config=cfg_dict)
示例4: setUp
def setUp(self):
super(ContentPackConfigParserTestCase, self).setUp()
tests_config.parse_args()
# Mock the packs_base_path
mock_path = tests_base.get_fixtures_path()
cfg.CONF.content.packs_base_path = mock_path
示例5: _do_setUpClass
def _do_setUpClass(cls):
tests_config.parse_args()
cfg.CONF.set_default('enable', cls.enable_auth, group='auth')
cfg.CONF.set_override(name='enable', override=False, group='rbac')
opts = cfg.CONF.api_pecan
cfg_dict = {
'app': {
'root': opts.root,
'template_path': opts.template_path,
'modules': opts.modules,
'debug': opts.debug,
'auth_enable': opts.auth_enable,
'errors': {'__force_dict__': True},
'guess_content_type_from_ext': False
}
}
# TODO(manas) : register action types here for now. RunnerType registration can be moved
# to posting to /runnertypes but that implies implementing POST.
runners_registrar.register_runner_types()
cls.app = load_test_app(config=cfg_dict)
示例6: setUp
def setUp(self):
super(DatastoreServiceTestCase, self).setUp()
config.parse_args()
self._datastore_service = BaseDatastoreService(logger=mock.Mock(),
pack_name='core',
class_name='TestSensor')
self._datastore_service._get_api_client = mock.Mock()
示例7: setUpClass
def setUpClass(cls):
tests_config.parse_args(coordinator_noop=True)
super(ServiceRegistryControllerRBACTestCase, cls).setUpClass()
cls.coordinator = coordination.get_coordinator(use_cache=False)
# Register mock service in the service registry for testing purposes
register_service_in_service_registry(service='mock_service',
capabilities={'key1': 'value1',
'name': 'mock_service'},
start_heart=True)
示例8: setUp
def setUp(self):
super(VirtualenvUtilsTestCase, self).setUp()
config.parse_args()
dir_path = tempfile.mkdtemp()
cfg.CONF.set_override(name='base_path', override=dir_path, group='system')
self.base_path = dir_path
self.virtualenvs_path = os.path.join(self.base_path, 'virtualenvs/')
# Make sure dir is deleted on tearDown
self.to_delete_directories.append(self.base_path)
示例9: setUpClass
def setUpClass(cls):
super(ServiceyRegistryControllerTestCase, cls).setUpClass()
tests_config.parse_args(coordinator_noop=True)
cls.coordinator = coordination.get_coordinator(use_cache=False)
# NOTE: We mock call common_setup to emulate service being registered in the service
# registry during bootstrap phase
register_service_in_service_registry(service='mock_service',
capabilities={'key1': 'value1',
'name': 'mock_service'},
start_heart=True)
示例10: _do_setUpClass
def _do_setUpClass(cls):
tests_config.parse_args()
cfg.CONF.set_default('enable', cls.enable_auth, group='auth')
cfg.CONF.set_override(name='enable', override=False, group='rbac')
# TODO(manas) : register action types here for now. RunnerType registration can be moved
# to posting to /runnertypes but that implies implementing POST.
if cls.register_runners:
runners_registrar.register_runners()
cls.app = TestApp(cls.app_module.setup_app())
示例11: setUpClass
def setUpClass(cls):
EventletTestCase.setUpClass()
DbTestCase.setUpClass()
# Override the coordinator to use the noop driver otherwise the tests will be blocked.
tests_config.parse_args(coordinator_noop=True)
coordination.COORDINATOR = None
# Register runners
runners_registrar.register_runners()
# Register common policy types
register_policy_types(st2common)
loader = FixturesLoader()
loader.save_fixtures_to_db(fixtures_pack=PACK,
fixtures_dict=TEST_FIXTURES)
示例12: setUpClass
def setUpClass(cls):
super(AuthMiddlewareTest, cls).setUpClass()
tests_config.parse_args()
opts = cfg.CONF.api_pecan
cfg_dict = {
'app': {
'root': opts.root,
'template_path': opts.template_path,
'modules': opts.modules,
'debug': opts.debug,
'auth_enable': opts.auth_enable,
'errors': {'__force_dict__': True}
}
}
# TODO(manas) : register action types here for now. RunnerType registration can be moved
# to posting to /runnertypes but that implies implementing POST.
runners_registrar.register_runner_types()
cls.app = TestApp(auth.AuthMiddleware(load_app(cfg_dict)))
示例13: setUpClass
def setUpClass(cls, **kwargs):
super(FunctionalTest, cls).setUpClass()
tests_config.parse_args()
cls.app = TestApp(app.setup_app(), **kwargs)
示例14: setUpClass
def setUpClass(cls):
tests_config.parse_args()
示例15: setUp
def setUp(self):
super(ContentPackConfigParserTestCase, self).setUp()
tests_config.parse_args()