From 6f08b9fc9c93f7ab8c3c826bfc17bedb7da5569e Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Tue, 19 Mar 2024 10:41:16 +0100 Subject: [PATCH] Add unit test for updating output hda copies --- test/unit/data/model/test_model_store.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/unit/data/model/test_model_store.py b/test/unit/data/model/test_model_store.py index 81c3d9f68b5f..5e0163ce12bb 100644 --- a/test/unit/data/model/test_model_store.py +++ b/test/unit/data/model/test_model_store.py @@ -827,6 +827,21 @@ def test_sessionless_import_edit_datasets(): assert d2 is not None +def test_import_job_with_output_copy(): + app, h, temp_directory, import_history = _setup_simple_export({"for_edit": True}) + hda = h.active_datasets[-1] + # Simulate a copy being made of an output hda + copy = hda.copy(new_name="output copy") + # set extension to auto, should be changed to real extension when finalizing job + copy.extension = "auto" + app.add_and_commit(copy) + import_model_store = store.get_import_model_store_for_directory( + temp_directory, import_options=store.ImportOptions(allow_dataset_object_edit=True, allow_edit=True), app=app + ) + import_model_store.perform_import() + assert copy.extension == "txt" + + def test_import_datasets_with_ids_fails_if_not_editing_models(): app, h, temp_directory, import_history = _setup_simple_export({"for_edit": True}) u = h.user