def _run_jihaw_cleanup(archive_dir, app=None): app = app or _mock_app() job = model.Job() job.tool_stderr = '' jiha = model.JobImportHistoryArchive(job=job, archive_dir=archive_dir) app.model.context.current.add_all([job, jiha]) app.model.context.flush() jihaw = JobImportHistoryArchiveWrapper(app, job.id) # yeehaw! return app, jihaw.cleanup_after_job()
def _run_jihaw_cleanup(history_archive, msg): app = MockApp() job = model.Job() job.stderr = '' jiha = model.JobImportHistoryArchive(job=job, archive_dir=history_archive.arc_directory) app.model.context.current.add_all([job, jiha]) app.model.context.flush() jihaw = JobImportHistoryArchiveWrapper(app, 1) # yeehaw! try: jihaw.cleanup_after_job() data = app.object_store.get_data(model.Dataset(1)) assert data != 'insecure', msg except MalformedContents: pass