Пример #1
0
 def create_value_wrapper(test_user, test_project=None):
     """
     Creates a ValueWrapper dataType, and the associated parent Operation.
     This is also used in ProjectStructureTest.
     """
     if test_project is None:
         test_project = TestFactory.create_project(test_user, 'test_proj')
     operation = TestFactory.create_operation(test_user=test_user, test_project=test_project)
     value_wrapper = ValueWrapper(data_value="5.0", data_name="my_value", data_type="float")
     op_dir = FilesHelper().get_project_folder(test_project, str(operation.id))
     vw_idx = h5.store_complete(value_wrapper, op_dir)
     vw_idx.fk_from_operation = operation.id
     vw_idx = dao.store_entity(vw_idx)
     return test_project, vw_idx.gid, operation
Пример #2
0
 def build_int_value_wrapper(self, result, key, title=""):
     value = ValueWrapper()
     value.data_value = str(int(result[key]))
     value.data_type = 'int'
     value.data_name = title
     return h5.store_complete(value, self.storage_path)
Пример #3
0
 def build_float_value_wrapper(self, result, key, title=""):
     value = ValueWrapper()
     value.data_value = str(float(result[key]))
     value.data_type = 'float'
     value.data_name = title
     return self.store_complete(value)