• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python config.parse_args函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中st2tests.config.parse_args函数的典型用法代码示例。如果您正苦于以下问题:Python parse_args函数的具体用法?Python parse_args怎么用?Python parse_args使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了parse_args函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: setUpClass

 def setUpClass(cls):
     super(SynchronizationTest, cls).setUpClass()
     tests_config.parse_args()
     cls.coordinator = coordination.get_coordinator()
开发者ID:azamsheriff,项目名称:st2,代码行数:4,代码来源:test_synchronization.py


示例17: setUpClass

 def setUpClass(cls):
     super(AccessServiceTest, cls).setUpClass()
     tests_config.parse_args()
开发者ID:meirwah,项目名称:st2,代码行数:3,代码来源:test_access.py


示例18: setUpClass

 def setUpClass(cls):
     super(SensorWrapperTestCase, cls).setUpClass()
     tests_config.parse_args()
开发者ID:AlexeyDeyneko,项目名称:st2,代码行数:3,代码来源:test_sensor_wrapper.py


示例19: setUp

 def setUp(self):
     parse_args()
开发者ID:AlexeyDeyneko,项目名称:st2,代码行数:2,代码来源:test_rbac_utils.py


示例20: parse_args

#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import unittest2

from oslo_config import cfg

from st2common.constants.api import DEFAULT_API_VERSION
from st2common.util.api import get_base_public_api_url
from st2common.util.api import get_full_public_api_url
from st2tests.config import parse_args
parse_args()


class APIUtilsTestCase(unittest2.TestCase):
    def test_get_base_public_api_url(self):
        values = [
            'http://foo.bar.com',
            'http://foo.bar.com/',
            'http://foo.bar.com:8080',
            'http://foo.bar.com:8080/',
            'http://localhost:8080/',
        ]
        expected = [
            'http://foo.bar.com',
            'http://foo.bar.com',
            'http://foo.bar.com:8080',
开发者ID:ipv1337,项目名称:st2,代码行数:31,代码来源:test_util_api.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python fixturesloader.get_fixtures_base_path函数代码示例发布时间:2022-05-27
下一篇:
Python filter.RuleFilter类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap