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


Python TestFactory.import_cff方法代码示例

本文整理汇总了Python中tvb.tests.framework.core.factory.TestFactory.import_cff方法的典型用法代码示例。如果您正苦于以下问题:Python TestFactory.import_cff方法的具体用法?Python TestFactory.import_cff怎么用?Python TestFactory.import_cff使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在tvb.tests.framework.core.factory.TestFactory的用法示例。


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

示例1: test_bad_reference

# 需要导入模块: from tvb.tests.framework.core.factory import TestFactory [as 别名]
# 或者: from tvb.tests.framework.core.factory.TestFactory import import_cff [as 别名]
    def test_bad_reference(self):
        TestFactory.import_cff(test_user=self.test_user, test_project=self.test_project)
        field = FilterChain.datatype + '.subject'
        filters = FilterChain('', [field], [TEST_SUBJECT_A], ['!='])
        bad_reference_connectivity = TestFactory.get_entity(self.test_project, Connectivity(), filters)

        with pytest.raises(OperationException):
            self._import_csv_test_connectivity(bad_reference_connectivity.gid, TEST_SUBJECT_A)
开发者ID:maedoc,项目名称:tvb-framework,代码行数:10,代码来源:csv_importer_test.py

示例2: transactional_setup_method

# 需要导入模块: from tvb.tests.framework.core.factory import TestFactory [as 别名]
# 或者: from tvb.tests.framework.core.factory.TestFactory import import_cff [as 别名]
 def transactional_setup_method(self):
     """
     Sets up the environment for running the tests;
     creates a test user and a test project, saves old configuration and imports a CFF data-set
     """
     self.test_user = TestFactory.create_user()
     self.test_project = TestFactory.create_project(self.test_user)
     TestFactory.import_cff(test_user=self.test_user, test_project=self.test_project)
开发者ID:maedoc,项目名称:tvb-framework,代码行数:10,代码来源:timeseries_metrics_adapter_test.py

示例3: transactional_setup_method

# 需要导入模块: from tvb.tests.framework.core.factory import TestFactory [as 别名]
# 或者: from tvb.tests.framework.core.factory.TestFactory import import_cff [as 别名]
    def transactional_setup_method(self):
        """
        Sets up the environment for running the tests;
        creates a test user, a test project, a connectivity and a surface;
        imports a CFF data-set
        """
        self.datatypeFactory = DatatypesFactory()
        self.test_project = self.datatypeFactory.get_project()
        self.test_user = self.datatypeFactory.get_user()

        TestFactory.import_cff(test_user=self.test_user, test_project=self.test_project)
        self.connectivity = TestFactory.get_entity(self.test_project, Connectivity())
        assert self.connectivity is not None
开发者ID:maedoc,项目名称:tvb-framework,代码行数:15,代码来源:crosscorelationviewer_test.py

示例4: transactional_setup_method

# 需要导入模块: from tvb.tests.framework.core.factory import TestFactory [as 别名]
# 或者: from tvb.tests.framework.core.factory.TestFactory import import_cff [as 别名]
 def transactional_setup_method(self):
     """
     Reset the database before each test.
     """
     self.import_service = ImportService()
     self.flow_service = FlowService()
     self.project_service = ProjectService()
     
     self.test_user = TestFactory.create_user()
     self.test_project = TestFactory.create_project(self.test_user, name="GeneratedProject", description="test_desc")
     self.operation = TestFactory.create_operation(test_user=self.test_user, test_project=self.test_project)
     self.adapter_instance = TestFactory.create_adapter()
     TestFactory.import_cff(test_user=self.test_user, test_project=self.test_project)
     self.zip_path = None 
开发者ID:maedoc,项目名称:tvb-framework,代码行数:16,代码来源:import_service_test.py

示例5: test_project_disk_size

# 需要导入模块: from tvb.tests.framework.core.factory import TestFactory [as 别名]
# 或者: from tvb.tests.framework.core.factory.TestFactory import import_cff [as 别名]
    def test_project_disk_size(self):
        project1 = TestFactory.create_project(self.test_user, 'test_proj1')
        zip_path = os.path.join(os.path.dirname(tvb_data.__file__), 'connectivity', 'connectivity_66.zip')
        TestFactory.import_zip_connectivity(self.test_user, project1, 'testSubject', zip_path)

        project2 = TestFactory.create_project(self.test_user, 'test_proj2')
        TestFactory.import_cff(test_user=self.test_user, test_project=project2)

        projects = self.project_service.retrieve_projects_for_user(self.test_user.id)[0]
        assert projects[0].disk_size != projects[1].disk_size, "projects should have different size"

        for project in projects:
            assert 0 != project.disk_size
            assert '0.0 KiB' != project.disk_size_human

            prj_folder = self.structure_helper.get_project_folder(project)
            actual_disk_size = self.compute_recursive_h5_disk_usage(prj_folder)[0]

            ratio = float(actual_disk_size) / project.disk_size
            msg = "Real disk usage: %s The one recorded in the db : %s" % (actual_disk_size, project.disk_size)
            assert ratio < 1.4, msg
开发者ID:maedoc,项目名称:tvb-framework,代码行数:23,代码来源:project_service_test.py

示例6: transactional_setup_method

# 需要导入模块: from tvb.tests.framework.core.factory import TestFactory [as 别名]
# 或者: from tvb.tests.framework.core.factory.TestFactory import import_cff [as 别名]
    def transactional_setup_method(self):
        """
        Sets up the environment for running the tests;
        creates a test user, a test project, a connectivity and a list of BCT adapters;
        imports a CFF data-set
        """
        self.test_user = TestFactory.create_user("BCT_User")
        self.test_project = TestFactory.create_project(self.test_user, "BCT-Project")
        ### Make sure Connectivity is in DB
        TestFactory.import_cff(test_user=self.test_user, test_project=self.test_project)
        self.connectivity = dao.get_generic_entity(Connectivity, 'John Doe', 'subject')[0]

        # make weights matrix symmetric, or else some BCT algorithms will run infinitely:
        w = self.connectivity.weights
        self.connectivity.weights = w + w.T - numpy.diag(w.diagonal())

        algorithms = dao.get_generic_entity(model.Algorithm, 'Brain Connectivity Toolbox', 'group_description')
        assert algorithms is not None
        assert len(algorithms) > 5

        self.bct_adapters = []
        for algo in algorithms:
            self.bct_adapters.append(ABCAdapter.build_adapter(algo))
开发者ID:maedoc,项目名称:tvb-framework,代码行数:25,代码来源:bct_test.py


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