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


Python test_utils.setup_test_storage函数代码示例

本文整理汇总了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()
开发者ID:ELDAELRA,项目名称:META-SHARE-3.1.1,代码行数:7,代码来源:test_search.py

示例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')
开发者ID:Atala,项目名称:META-SHARE,代码行数:29,代码来源:tests.py

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

示例4: setUp

 def setUp(self):
     """
     Set up the view
     """
     test_utils.setup_test_storage()
     normaluser = create_user('normaluser', '[email protected]', 'secret')
     normaluser.save()
开发者ID:ELDAELRA,项目名称:META-SHARE-3.1.1,代码行数:7,代码来源:test_search.py

示例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))
开发者ID:JuliBakagianni,项目名称:CEF-ELRC,代码行数:7,代码来源:test_model.py

示例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
开发者ID:marc1s,项目名称:META-SHARE,代码行数:8,代码来源:test_editor.py

示例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
开发者ID:kperi,项目名称:META-SHARE,代码行数:8,代码来源:test_status_workflow.py

示例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()
开发者ID:Atala,项目名称:META-SHARE,代码行数:9,代码来源:test_email.py

示例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()
开发者ID:jvivaldi,项目名称:META-SHARE,代码行数:9,代码来源:test_search.py

示例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')
开发者ID:Atala,项目名称:META-SHARE,代码行数:9,代码来源:test_special_queries.py

示例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,])
开发者ID:ELDAELRA,项目名称:META-SHARE-3.1.1,代码行数:10,代码来源:test_special_queries.py

示例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')
开发者ID:Atala,项目名称:META-SHARE,代码行数:10,代码来源:test_import.py

示例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()
开发者ID:marc1s,项目名称:META-SHARE,代码行数:11,代码来源:test_search.py

示例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']
开发者ID:marc1s,项目名称:META-SHARE,代码行数:13,代码来源:tests.py

示例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),))
开发者ID:JuliBakagianni,项目名称:CEF-ELRC,代码行数:16,代码来源:test_view.py


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