本文整理汇总了Python中metashare.test_utils.setup_test_storage函数的典型用法代码示例。如果您正苦于以下问题:Python setup_test_storage函数的具体用法?Python setup_test_storage怎么用?Python setup_test_storage使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setup_test_storage函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setUpClass
def setUpClass(cls):
"""
Set up the view
"""
LOGGER.info("running '{}' tests...".format(cls.__name__))
test_utils.setup_test_storage()
cls.importPublishedFixtures()
示例2: setUpClass
def setUpClass(cls):
"""
Import a resource to test the workflow changes for
"""
LOGGER.info("running '{}' tests...".format(cls.__name__))
test_utils.set_index_active(False)
test_utils.setup_test_storage()
_test_editor_group = \
EditorGroup.objects.create(name='test_editor_group')
_test_manager_group = \
EditorGroupManagers.objects.create(name='test_manager_group',
managed_group=_test_editor_group)
owner = test_utils.create_manager_user(
'manageruser', '[email protected]', 'secret',
(_test_editor_group, _test_manager_group))
# load first resource
_fixture = '{0}/repository/fixtures/testfixture.xml'.format(ROOT_PATH)
_result = test_utils.import_xml(_fixture)
_result.editor_groups.add(_test_editor_group)
_result.owners.add(owner)
# load second resource
_fixture = '{0}/repository/test_fixtures/ingested-corpus-AudioVideo-French.xml'.format(ROOT_PATH)
_result = test_utils.import_xml(_fixture)
_result.editor_groups.add(_test_editor_group)
_result.owners.add(owner)
# create a normal user
test_utils.create_user('user', '[email protected]', 'mypasswd')
示例3: setUp
def setUp(self):
"""
Import test fixtures and add resource pairs to TogetherManager
"""
test_utils.setup_test_storage()
self.res_1 = _import_resource('elra112.xml')
self.res_2 = _import_resource('elra135.xml')
self.res_3 = _import_resource('elra260.xml')
self.res_4 = _import_resource('elra295.xml')
man = TogetherManager.getManager(Resource.VIEW)
count = 0
while (count < 5):
man.addResourcePair(self.res_1, self.res_2)
count += 1
count = 0
while (count < 10):
man.addResourcePair(self.res_1, self.res_3)
count += 1
count = 0
while (count < 3):
man.addResourcePair(self.res_1, self.res_4)
count += 1
man = TogetherManager.getManager(Resource.DOWNLOAD)
count = 0
while (count < 15):
man.addResourcePair(self.res_1, self.res_2)
count += 1
count = 0
while (count < 10):
man.addResourcePair(self.res_1, self.res_3)
count += 1
count = 0
while (count < 5):
man.addResourcePair(self.res_1, self.res_4)
count += 1
示例4: setUp
def setUp(self):
"""
Set up the view
"""
test_utils.setup_test_storage()
normaluser = create_user('normaluser', '[email protected]', 'secret')
normaluser.save()
示例5: setUp
def setUp(self):
"""
Imports a few test resources.
"""
test_utils.setup_test_storage()
self.test_res_1 = test_utils.import_xml("{0}/repository/fixtures/testfixture.xml".format(ROOT_PATH))
self.test_res_2 = test_utils.import_xml("{0}/repository/fixtures/ILSP10.xml".format(ROOT_PATH))
示例6: import_test_resource
def import_test_resource(cls, editor_group=None, path=TESTFIXTURE_XML):
test_utils.setup_test_storage()
result = test_utils.import_xml(path)
resource = result[0]
if not editor_group is None:
resource.editor_groups.add(editor_group)
resource.save()
return resource
示例7: setUp
def setUp(self):
"""
Import a resource to test the workflow changes for
"""
test_utils.setup_test_storage()
_fixture = '{0}/repo2/fixtures/testfixture.xml'.format(ROOT_PATH)
_result = test_utils.import_xml(_fixture)
self.resource_id = _result[0].id
示例8: setUp
def setUp(self):
"""
Set up the email test
"""
test_utils.setup_test_storage()
_fixture = '{0}/repository/fixtures/testfixture.xml'.format(ROOT_PATH)
self.resource = test_utils.import_xml(_fixture)
self.resource.storage_object.published = True
self.resource.storage_object.save()
示例9: setUpClass
def setUpClass(cls):
"""
Set up the view
"""
LOGGER.info("running '{}' tests...".format(cls.__name__))
test_utils.setup_test_storage()
# Make sure the index does not contain any stale entries:
call_command('rebuild_index', interactive=False, using=settings.TEST_MODE_NAME)
cls.importPublishedFixtures()
示例10: setUp
def setUp(self):
"""
Import test fixtures and add resource pairs to TogetherManager
"""
test_utils.setup_test_storage()
self.res_1 = _import_resource('creators-projects-1.xml')
self.res_2 = _import_resource('creators-projects-2.xml')
self.res_3 = _import_resource('creators-projects-3.xml')
self.res_4 = _import_resource('creators-projects-4.xml')
示例11: setUp
def setUp(self):
"""
Import test fixtures and add resource pairs to TogetherManager
"""
test_utils.setup_test_storage()
self.res_1 = _import_resource('creators-projects-1.xml')
self.res_2 = _import_resource('creators-projects-2.xml')
self.res_3 = _import_resource('creators-projects-3.xml')
self.res_4 = _import_resource('creators-projects-4.xml')
update_index.Command().handle(using=[settings.TEST_MODE_NAME,])
示例12: setUp
def setUp(self):
"""
Set up the import test
"""
test_utils.setup_test_storage()
ImportTest.test_editor_group = EditorGroup.objects.create(
name='test_editor_group')
ImportTest.super_user = User.objects.create_superuser('superuser', '[email protected]', 'secret')
示例13: setUp
def setUp(self):
"""
Set up the view
"""
test_utils.setup_test_storage()
staffuser = create_user("staffuser", "[email protected]", "secret")
staffuser.is_staff = True
staffuser.save()
normaluser = create_user("normaluser", "[email protected]", "secret")
normaluser.save()
示例14: setUp
def setUp(self):
"""
Creates a new storage object instance for testing.
"""
test_utils.setup_test_storage()
folder = '{0}/storage/test_fixtures/updatetest'.format(settings.ROOT_PATH)
with open('{0}/storage-global.json'.format(folder), 'rb') as storagein:
self.storage_json = json.load(storagein)
with open('{0}/metadata-before.xml'.format(folder), 'rb') as metadatain:
self.metadata_before = metadatain.read()
with open('{0}/metadata-modified.xml'.format(folder), 'rb') as metadatain:
self.metadata_modified = metadatain.read()
self.storage_id = self.storage_json['identifier']
示例15: setUp
def setUp(self):
"""
Set up the detail view
"""
test_utils.setup_test_storage()
create_user('normaluser', '[email protected]', 'secret')
_test_editor_group = EditorGroup.objects.create(
name='test_editor_group')
self.resource = _import_resource('testfixture.xml',
_test_editor_group)
ViewTest.test_editor = test_utils.create_editor_user('editoruser',
'[email protected]', 'secret', (_test_editor_group,))
test_utils.create_manager_user('manageruser', '[email protected]',
'secret', (EditorGroupManagers.objects.create(
name='test_editor_group_manager',
managed_group=_test_editor_group),))