当前位置: 首页>>代码示例>>Python>>正文


Python config.parse_args函数代码示例

本文整理汇总了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
开发者ID:lyandut,项目名称:st2,代码行数:7,代码来源:test_util_sandboxing.py

示例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()
开发者ID:AlexeyDeyneko,项目名称:st2,代码行数:7,代码来源:test_hash_partitioner.py

示例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)
开发者ID:langelee,项目名称:st2,代码行数:28,代码来源:base.py

示例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
开发者ID:bjoernbessert,项目名称:st2,代码行数:7,代码来源:test_config_parser.py

示例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)
开发者ID:Bala96,项目名称:st2,代码行数:25,代码来源:base.py

示例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()
开发者ID:lyandut,项目名称:st2,代码行数:8,代码来源:test_datastore.py

示例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)
开发者ID:nzlosh,项目名称:st2,代码行数:12,代码来源:test_service_registry_rbac.py

示例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)
开发者ID:E-LLP,项目名称:st2,代码行数:12,代码来源:test_virtualenvs.py

示例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)
开发者ID:nzlosh,项目名称:st2,代码行数:13,代码来源:test_service_registry.py

示例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())
开发者ID:StackStorm,项目名称:st2,代码行数:13,代码来源:api.py

示例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)
开发者ID:StackStorm,项目名称:st2,代码行数:17,代码来源:test_concurrency.py

示例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)))
开发者ID:BlazeMediaGroup,项目名称:st2,代码行数:21,代码来源:base.py

示例13: setUpClass

 def setUpClass(cls, **kwargs):
     super(FunctionalTest, cls).setUpClass()
     tests_config.parse_args()
     cls.app = TestApp(app.setup_app(), **kwargs)
开发者ID:StackStorm,项目名称:st2,代码行数:4,代码来源:base.py

示例14: setUpClass

 def setUpClass(cls):
     tests_config.parse_args()
开发者ID:nagyist,项目名称:StackStorm-st2,代码行数:2,代码来源:test_pythonrunner.py

示例15: setUp

 def setUp(self):
     super(ContentPackConfigParserTestCase, self).setUp()
     tests_config.parse_args()
开发者ID:AlexeyDeyneko,项目名称:st2,代码行数:3,代码来源:test_config_parser.py


注:本文中的st2tests.config.parse_args函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。