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


Python TestFactory.import_surface_zip方法代码示例

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


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

示例1: test_launch_EEG

# 需要导入模块: from tvb.tests.framework.core.test_factory import TestFactory [as 别名]
# 或者: from tvb.tests.framework.core.test_factory.TestFactory import import_surface_zip [as 别名]
    def test_launch_EEG(self):
        """
        Check that all required keys are present in output from EegSensorViewer launch.
        """
        ## Import Sensors
        zip_path = os.path.join(os.path.dirname(sensors_dataset.__file__), 'EEG_unit_vectors_BrainProducts_62.txt.bz2')
        TestFactory.import_sensors(self.test_user, self.test_project, zip_path, Sensors_Importer.EEG_SENSORS)
        sensors = TestFactory.get_entity(self.test_project, SensorsEEG())

        ## Import EEGCap
        zip_path = os.path.join(os.path.dirname(surfaces_dataset.__file__), 'eeg_skin_surface.zip')
        TestFactory.import_surface_zip(self.test_user, self.test_project, zip_path, EEG_CAP, True)
        eeg_cap_surface = TestFactory.get_entity(self.test_project, EEGCap())

        viewer = EegSensorViewer()
        viewer.current_project_id = self.test_project.id

        ## Launch with EEG Cap selected
        result = viewer.launch(sensors, eeg_cap_surface)
        self.assert_compliant_dictionary(self.EXPECTED_KEYS_EEG, result)
        for key in ['urlVertices', 'urlTriangles', 'urlLines', 'urlNormals']:
            self.assertIsNotNone(result[key], "Value at key %s should not be None" % key)

        ## Launch without EEG Cap
        result = viewer.launch(sensors)
        self.assert_compliant_dictionary(self.EXPECTED_KEYS_EEG, result)
        for key in ['urlVertices', 'urlTriangles', 'urlLines', 'urlNormals']:
            self.assertTrue(not result[key] or result[key] == "[]",
                            "Value at key %s should be None or empty, but is %s" % (key, result[key]))
开发者ID:unimauro,项目名称:tvb-framework,代码行数:31,代码来源:sensorsviewer_test.py

示例2: setUp

# 需要导入模块: from tvb.tests.framework.core.test_factory import TestFactory [as 别名]
# 或者: from tvb.tests.framework.core.test_factory.TestFactory import import_surface_zip [as 别名]
    def setUp(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()

        ## Import Shelf Face Object
        zip_path = os.path.join(os.path.dirname(surfaces_dataset.__file__), 'face_surface_old.zip')
        TestFactory.import_surface_zip(self.test_user, self.test_project, zip_path, FACE, True)
开发者ID:unimauro,项目名称:tvb-framework,代码行数:15,代码来源:sensorsviewer_test.py

示例3: setUp

# 需要导入模块: from tvb.tests.framework.core.test_factory import TestFactory [as 别名]
# 或者: from tvb.tests.framework.core.test_factory.TestFactory import import_surface_zip [as 别名]
    def setUp(self):
        """
        Reset the database before each test.
        """
        self.test_user = TestFactory.create_user("UserPM")
        self.test_project = TestFactory.create_project(self.test_user)

        zip_path = os.path.join(os.path.dirname(tvb_data.sensors.__file__), "eeg_brainstorm_65.txt")
        TestFactory.import_sensors(self.test_user, self.test_project, zip_path, Sensors_Importer.EEG_SENSORS)

        zip_path = os.path.join(os.path.dirname(tvb_data.surfaceData.__file__), "cortex_16384.zip")
        TestFactory.import_surface_zip(self.test_user, self.test_project, zip_path, CORTICAL, True)

        self.surface = TestFactory.get_entity(self.test_project, CorticalSurface())
        self.assertTrue(self.surface is not None)
        self.sensors = TestFactory.get_entity(self.test_project, SensorsEEG())
        self.assertTrue(self.sensors is not None)
开发者ID:lcosters,项目名称:tvb-framework,代码行数:19,代码来源:projection_matrix_importer_test.py


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