本文整理汇总了Python中tvb.tests.framework.core.factory.TestFactory.import_zip_connectivity方法的典型用法代码示例。如果您正苦于以下问题:Python TestFactory.import_zip_connectivity方法的具体用法?Python TestFactory.import_zip_connectivity怎么用?Python TestFactory.import_zip_connectivity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tvb.tests.framework.core.factory.TestFactory
的用法示例。
在下文中一共展示了TestFactory.import_zip_connectivity方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_project_disk_size
# 需要导入模块: from tvb.tests.framework.core.factory import TestFactory [as 别名]
# 或者: from tvb.tests.framework.core.factory.TestFactory import import_zip_connectivity [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
示例2: transactional_setup_method
# 需要导入模块: from tvb.tests.framework.core.factory import TestFactory [as 别名]
# 或者: from tvb.tests.framework.core.factory.TestFactory import import_zip_connectivity [as 别名]
def transactional_setup_method(self):
zip_path = os.path.join(os.path.dirname(tvb_data.__file__), 'connectivity', 'connectivity_66.zip')
self.test_user = TestFactory.create_user('Test_User')
self.test_project = TestFactory.create_project(self.test_user, "Test_Project")
TestFactory.import_zip_connectivity(self.test_user,self.test_project, "John", zip_path)
self.connectivity = TestFactory.get_entity(self.test_project, Connectivity())