本文整理汇总了Python中tvb.tests.framework.core.test_factory.TestFactory.get_entity_count方法的典型用法代码示例。如果您正苦于以下问题:Python TestFactory.get_entity_count方法的具体用法?Python TestFactory.get_entity_count怎么用?Python TestFactory.get_entity_count使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tvb.tests.framework.core.test_factory.TestFactory
的用法示例。
在下文中一共展示了TestFactory.get_entity_count方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_happy_flow_import
# 需要导入模块: from tvb.tests.framework.core.test_factory import TestFactory [as 别名]
# 或者: from tvb.tests.framework.core.test_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.
"""
ConnectivityZipTest.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())
self.assertEqual(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
self.assertTrue((reference_connectivity.centres == imported_connectivity.centres).all())
self.assertTrue((reference_connectivity.orientations == imported_connectivity.orientations).all())
self.assertEqual(reference_connectivity.number_of_regions, imported_connectivity.number_of_regions)
self.assertTrue((reference_connectivity.region_labels == imported_connectivity.region_labels).all())
self.assertFalse((reference_connectivity.weights == imported_connectivity.weights).all())
self.assertFalse((reference_connectivity.tract_lengths == imported_connectivity.tract_lengths).all())
示例2: test_happy_flow_surface_import
# 需要导入模块: from tvb.tests.framework.core.test_factory import TestFactory [as 别名]
# 或者: from tvb.tests.framework.core.test_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())
group = dao.find_group(
"tvb.adapters.uploaders.projection_matrix_importer", "ProjectionMatrixSurfaceEEGImporter"
)
importer = ABCAdapter.build_adapter(group)
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(importer, self.test_user, self.test_project.id, **args)
dt_count_after = TestFactory.get_entity_count(self.test_project, ProjectionSurfaceEEG())
self.assertEqual(dt_count_before + 1, dt_count_after)
示例3: test_happy_flow_import
# 需要导入模块: from tvb.tests.framework.core.test_factory import TestFactory [as 别名]
# 或者: from tvb.tests.framework.core.test_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.
"""
dt_count_before = TestFactory.get_entity_count(self.test_project, Connectivity())
ConnectivityZipTest.import_test_connectivity96(self.test_user, self.test_project)
dt_count_after = TestFactory.get_entity_count(self.test_project, Connectivity())
self.assertEqual(dt_count_before + 1, dt_count_after)
示例4: test_happy_flow_surface_import
# 需要导入模块: from tvb.tests.framework.core.test_factory import TestFactory [as 别名]
# 或者: from tvb.tests.framework.core.test_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())
self.assertEqual(dt_count_before + 1, dt_count_after)
示例5: test_happy_flow_region_import
# 需要导入模块: from tvb.tests.framework.core.test_factory import TestFactory [as 别名]
# 或者: from tvb.tests.framework.core.test_factory.TestFactory import get_entity_count [as 别名]
def test_happy_flow_region_import(self):
"""
Verifies the happy flow for importing a region.
"""
dt_count_before = TestFactory.get_entity_count(self.test_project, ProjectionRegionEEG())
group = dao.find_group('tvb.adapters.uploaders.projection_matrix_importer', 'ProjectionMatrixRegionEEGImporter')
importer = ABCAdapter.build_adapter(group)
zip_path = os.path.join(os.path.abspath(os.path.dirname(dataset.__file__)), 'region_conn_74_eeg_1020_62.mat')
args = {'projection_file': zip_path,
'dataset_name': 'ProjectionMatrix',
'connectivity': self.connectivity.gid,
'sensors': self.sensors.gid,
DataTypeMetaData.KEY_SUBJECT: DataTypeMetaData.DEFAULT_SUBJECT}
FlowService().fire_operation(importer, self.test_user, self.test_project.id, **args)
dt_count_after = TestFactory.get_entity_count(self.test_project, ProjectionRegionEEG())
self.assertEqual(dt_count_before + 1, dt_count_after)
示例6: test_happy_flow
# 需要导入模块: from tvb.tests.framework.core.test_factory import TestFactory [as 别名]
# 或者: from tvb.tests.framework.core.test_factory.TestFactory import get_entity_count [as 别名]
def test_happy_flow(self):
self.assertEqual(0, TestFactory.get_entity_count(self.test_project, ConnectivityMeasure()))
self._import('mantini_networks.mat')
self.assertEqual(6, TestFactory.get_entity_count(self.test_project, ConnectivityMeasure()))