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


Python config.copy函数代码示例

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


在下文中一共展示了copy函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: setup_class

    def setup_class(cls):
        cls._original_config = config.copy()
        config['ckan.plugins'] = 'resource_proxy'
        wsgiapp = middleware.make_app(config['global_conf'], **config)
        cls.app = paste.fixture.TestApp(wsgiapp)

        # create test resource
        create_test_data.CreateTestData.create()
开发者ID:1sha1,项目名称:ckan,代码行数:8,代码来源:test_proxy.py

示例2: setup_class

 def setup_class(cls):
     CreateTestData.create()
     cls._original_config = config.copy()
     wsgiapp = ckan.config.middleware.make_app(
         config['global_conf'], **config)
     cls.app = paste.fixture.TestApp(wsgiapp)
     cls.sysadmin_user = model.User.get('testsysadmin')
     PylonsTestCase.setup_class()
开发者ID:6779660,项目名称:ckan,代码行数:8,代码来源:test_user.py

示例3: setup_class

    def setup_class(cls):
        cls.original_config = config.copy()

        cls._load_plugins()
        cls.app = _get_test_app()

        search.clear()
        helpers.reset_db()
        cls._create_test_data()
开发者ID:aalecs,项目名称:hdx-ckan-ci,代码行数:9,代码来源:hdx_test_base.py

示例4: setup_class

 def setup_class(cls):
     CreateTestData.create()
     cls._original_config = config.copy()
     config['ckan.auth.create_user_via_web'] = True
     new_authz.clear_auth_functions_cache()
     wsgiapp = ckan.config.middleware.make_app(
         config['global_conf'], **config)
     cls.app = paste.fixture.TestApp(wsgiapp)
     cls.sysadmin_user = model.User.get('testsysadmin')
     PylonsTestCase.setup_class()
开发者ID:1sha1,项目名称:ckan,代码行数:10,代码来源:test_user.py

示例5: wrapper

        def wrapper(*args, **kwargs):
            _original_config = config.copy()
            config[key] = value

            return_value = func(*args, **kwargs)

            config.clear()
            config.update(_original_config)

            return return_value
开发者ID:AAEMCJALBERT,项目名称:ckan,代码行数:10,代码来源:helpers.py

示例6: setup_class

 def setup_class(cls):
     cls._original_config = config.copy()
     config['ckan.plugins'] = 'resource_proxy'
     wsgiapp = middleware.make_app(config['global_conf'], **config)
     cls.app = paste.fixture.TestApp(wsgiapp)
     create_test_data.CreateTestData.create()
     # Httpretty crashes with Solr on Python 2.6,
     # skip the tests
     if (sys.version_info[0] == 2 and sys.version_info[1] == 6):
         raise nose.SkipTest()
开发者ID:HatemAlSum,项目名称:ckan,代码行数:10,代码来源:test_proxy.py

示例7: setup_class

 def setup_class(cls):
     if not p.plugin_loaded('recline_view'):
         p.load('recline_view')
     if not p.plugin_loaded('datastore'):
         p.load('datastore')
     app_config = config.copy()
     app_config['ckan.legacy_templates'] = 'false'
     app_config['ckan.plugins'] = 'recline_view datastore'
     app_config['ckan.views.default_views'] = 'recline_view'
     wsgiapp = middleware.make_app(config['global_conf'], **app_config)
     cls.app = paste.fixture.TestApp(wsgiapp)
开发者ID:Hoedic,项目名称:ckan,代码行数:11,代码来源:test_view.py

示例8: wrapper

        def wrapper(*args, **kwargs):
            _original_config = config.copy()
            config[key] = value
            new_authz.clear_auth_functions_cache()

            return_value = func(*args, **kwargs)

            config.clear()
            config.update(_original_config)
            new_authz.clear_auth_functions_cache()

            return return_value
开发者ID:BigOpenData,项目名称:ckan,代码行数:12,代码来源:helpers.py

示例9: test_profiles_via_config_option

    def test_profiles_via_config_option(self):

        original_config = config.copy()

        config[RDF_PROFILES_CONFIG_OPTION] = 'profile_conf_1 profile_conf_2'
        try:
            RDFParser()
        except RDFProfileException as e:

            eq_(str(e), 'Unknown RDF profiles: profile_conf_1, profile_conf_2')

        config.clear()
        config.update(original_config)
开发者ID:AQUACROSS,项目名称:ckanext-dcat,代码行数:13,代码来源:test_base_parser.py

示例10: setup_class

    def setup_class(cls):
        cls._original_config = config.copy()
        for key in config.keys():
            if key.startswith('ofs'):
                del config[key]
        config['ofs.impl'] = 'pairtree'
        config['ckan.storage.bucket'] = 'ckantest'
        config['ofs.storage_dir'] = '/tmp/ckan-test-ckanext-storage'

        create_pairtree_marker( config['ofs.storage_dir'] )
        wsgiapp = make_app(config['global_conf'], **config)
        cls.app = paste.fixture.TestApp(wsgiapp)

        CreateTestData.create_test_user()
开发者ID:Accela-Inc,项目名称:ckan,代码行数:14,代码来源:test_storage.py

示例11: setup_class

    def setup_class(cls):
        cls._original_config = config.copy()
        config['ckan.plugins'] = 'resource_proxy'
        wsgiapp = middleware.make_app(config['global_conf'], **config)
        cls.app = paste.fixture.TestApp(wsgiapp)

        if not cls.serving:
            file_server.serve()
            cls.serving = True
            # gets shutdown when nose finishes all tests,
            # so don't restart ever

        # create test resource
        create_test_data.CreateTestData.create()
开发者ID:ArnY,项目名称:ckan,代码行数:14,代码来源:test_proxy.py

示例12: setup_class

    def setup_class(cls):
        cls._original_config = config.copy()
        config["ckan.plugins"] = "recline_preview"
        wsgiapp = make_app(config["global_conf"], **config)
        cls.app = paste.fixture.TestApp(wsgiapp)

        cls.p = previewplugin.ReclinePreview()

        # create test resource
        CreateTestData.create()

        context = {"model": model, "session": model.Session, "user": model.User.get("testsysadmin").name}

        cls.package = model.Package.get("annakarenina")
        cls.resource = logic.get_action("resource_show")(context, {"id": cls.package.resources[1].id})
        cls.resource["url"] = pylons.config.get("ckan.site_url", "//localhost:5000")
        cls.resource["format"] = "csv"
        logic.action.update.resource_update(context, cls.resource)
开发者ID:agalino,项目名称:Aragon-Open-data-Website,代码行数:18,代码来源:test_preview.py

示例13: setup_class

    def setup_class(cls):
#        TestAuth.setup_class()
        CreateTestData.create_group_hierarchy_test_data()

        cls.apikeys = {}
        for user in model.Session.query(model.User):
            cls.apikeys[user.name] = str(user.apikey)

        cls._original_config = config.copy()

        config['ckan.auth.roles_that_cascade_to_sub_groups'] = 'admin'

        wsgiapp = ckan.config.middleware.make_app(
            config['global_conf'], **config)
        cls.app = paste.fixture.TestApp(wsgiapp)

        CreateTestData.create_arbitrary(
            package_dicts= [{'name': 'adataset',
                             'groups': ['national-health-service']}],
            extra_user_names=['john'])
开发者ID:EnxEng,项目名称:ckan,代码行数:20,代码来源:test_auth.py

示例14: setup_class

    def setup_class(cls):
        cls._original_config = config.copy()
        config['ckan.plugins'] = 'json_preview'
        wsgiapp = make_app(config['global_conf'], **config)
        cls.app = paste.fixture.TestApp(wsgiapp)

        cls.p = previewplugin.JsonPreview()

        # create test resource
        CreateTestData.create()

        context = {
            'model': model,
            'session': model.Session,
            'user': model.User.get('testsysadmin').name
        }

        cls.package = model.Package.get('annakarenina')
        cls.resource = logic.get_action('resource_show')(context, {'id': cls.package.resources[1].id})
        cls.resource['url'] = pylons.config.get('ckan.site_url', '//localhost:5000')
        logic.action.update.resource_update(context, cls.resource)
开发者ID:31H0B1eV,项目名称:ckan,代码行数:21,代码来源:test_preview.py

示例15: setup_class

    def setup_class(cls):
        cls._original_config = config.copy()

        # Disable the email notifications feature.
        config['ckan.activity_streams_email_notifications'] = False

        wsgiapp = ckan.config.middleware.make_app(config['global_conf'],
                **config)
        cls.app = paste.fixture.TestApp(wsgiapp)

        mock_mail_server.SmtpServerHarness.setup_class()
        pylons_controller.PylonsTestCase.setup_class()
        tests.CreateTestData.create()

        joeadmin = model.User.get('joeadmin')
        cls.joeadmin = {'id': joeadmin.id,
                'apikey': joeadmin.apikey,
                }
        testsysadmin = model.User.get('testsysadmin')
        cls.testsysadmin = {'id': testsysadmin.id,
                'apikey': testsysadmin.apikey,
                }
开发者ID:1sha1,项目名称:ckan,代码行数:22,代码来源:test_email_notifications.py


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