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


Python TestFactory.get_entity_count方法代码示例

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


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

示例1: test_happy_flow_import

# 需要导入模块: from tvb.tests.framework.core.factory import TestFactory [as 别名]
# 或者: from tvb.tests.framework.core.factory.TestFactory import get_entity_count [as 别名]
    def test_happy_flow_import(self):
        """
        Test that importing a CFF generates at least one DataType in DB.
        """
        TestConnectivityZip.import_test_connectivity96(self.test_user,
                                                       self.test_project,
                                                       subject=TEST_SUBJECT_A)

        field = FilterChain.datatype + '.subject'
        filters = FilterChain('', [field], [TEST_SUBJECT_A], ['=='])
        reference_connectivity = TestFactory.get_entity(self.test_project, Connectivity(), filters)

        dt_count_before = TestFactory.get_entity_count(self.test_project, Connectivity())

        self._import_csv_test_connectivity(reference_connectivity.gid, TEST_SUBJECT_B)

        dt_count_after = TestFactory.get_entity_count(self.test_project, Connectivity())
        assert dt_count_before + 1 == dt_count_after

        filters = FilterChain('', [field], [TEST_SUBJECT_B], ['like'])
        imported_connectivity = TestFactory.get_entity(self.test_project, Connectivity(), filters)

        # check relationship between the imported connectivity and the reference
        assert (reference_connectivity.centres == imported_connectivity.centres).all()
        assert (reference_connectivity.orientations == imported_connectivity.orientations).all()

        assert reference_connectivity.number_of_regions == imported_connectivity.number_of_regions
        assert (reference_connectivity.region_labels == imported_connectivity.region_labels).all()

        assert not (reference_connectivity.weights == imported_connectivity.weights).all()
        assert not (reference_connectivity.tract_lengths == imported_connectivity.tract_lengths).all()
开发者ID:maedoc,项目名称:tvb-framework,代码行数:33,代码来源:csv_importer_test.py

示例2: test_happy_flow_surface_import

# 需要导入模块: from tvb.tests.framework.core.factory import TestFactory [as 别名]
# 或者: from tvb.tests.framework.core.factory.TestFactory import get_entity_count [as 别名]
    def test_happy_flow_surface_import(self):
        """
        Verifies the happy flow for importing a surface.
        """
        dt_count_before = TestFactory.get_entity_count(self.test_project, ProjectionSurfaceEEG())
        file_path = os.path.join(os.path.abspath(os.path.dirname(dataset.__file__)),
                                 'projection_eeg_65_surface_16k.npy')
        args = {'projection_file': file_path,
                'dataset_name': 'ProjectionMatrix',
                'sensors': self.sensors.gid,
                'surface': self.surface.gid,
                DataTypeMetaData.KEY_SUBJECT: DataTypeMetaData.DEFAULT_SUBJECT}

        FlowService().fire_operation(self.importer, self.test_user, self.test_project.id, **args)
        dt_count_after = TestFactory.get_entity_count(self.test_project, ProjectionSurfaceEEG())

        assert dt_count_before + 1 == dt_count_after
开发者ID:maedoc,项目名称:tvb-framework,代码行数:19,代码来源:projection_matrix_importer_test.py

示例3: test_happy_flow

# 需要导入模块: from tvb.tests.framework.core.factory import TestFactory [as 别名]
# 或者: from tvb.tests.framework.core.factory.TestFactory import get_entity_count [as 别名]
 def test_happy_flow(self):
     assert 0 == TestFactory.get_entity_count(self.test_project, ConnectivityMeasure())
     self._import('mantini_networks.mat')
     assert 6 == TestFactory.get_entity_count(self.test_project, ConnectivityMeasure())
开发者ID:maedoc,项目名称:tvb-framework,代码行数:6,代码来源:connectivity_measure_importer_test.py


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