本文整理汇总了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()
示例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()
示例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()
示例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()
示例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
示例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()
示例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)
示例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
示例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)
示例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()
示例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()
示例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)
示例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'])
示例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)
示例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,
}