def _import_export(app, h, dest_export=None): if dest_export is None: dest_parent = mkdtemp() dest_export = os.path.join(dest_parent, "moo.tgz") jeha = model.JobExportHistoryArchive(job=None, history=h, dataset=None, compressed=True) wrapper = JobExportHistoryArchiveWrapper(app, 1) wrapper.setup_job(jeha) from galaxy.tools.imp_exp import export_history ret = export_history.main(["--gzip", jeha.temp_directory, dest_export]) assert ret == 0, ret _, imported_history = import_archive(dest_export, app=app) assert imported_history return imported_history
def _import_export(app, h, dest_export=None): if dest_export is None: dest_parent = tempfile.mkdtemp() dest_export = os.path.join(dest_parent, "moo.tgz") job = model.Job() jeha = model.JobExportHistoryArchive.create_for_history( h, job, app.model.context, app.object_store, compressed=True ) wrapper = JobExportHistoryArchiveWrapper(app, job.id) wrapper.setup_job(h, jeha.temp_directory) from galaxy.tools.imp_exp import export_history ret = export_history.main(["--gzip", jeha.temp_directory, dest_export]) assert ret == 0, ret _, imported_history = import_archive(dest_export, app=app) assert imported_history return imported_history