From bce4da7bc8837b35854e08b7ffbd9258219c709f Mon Sep 17 00:00:00 2001 From: John Chilton Date: Wed, 11 Oct 2017 15:09:03 -0400 Subject: [PATCH] Add another upload test this time with no dbkey param. Works fine... --- test/api/test_tools_upload.py | 28 ++++++++++++++++++++++++++++ test/base/populators.py | 2 ++ 2 files changed, 30 insertions(+) diff --git a/test/api/test_tools_upload.py b/test/api/test_tools_upload.py index c1584023111..3a82672b93b 100644 --- a/test/api/test_tools_upload.py +++ b/test/api/test_tools_upload.py @@ -189,6 +189,34 @@ class ToolsUploadTestCase(api.ApiTestCase): assert datasets[1]["file_ext"] == "txt" assert datasets[1]["genome_build"] == "hg18", datasets + def test_upload_multiple_files_no_dbkey(self): + with self.dataset_populator.test_history() as history_id: + payload = self.dataset_populator.upload_payload(history_id, "Test123", + file_type="tabular", + dbkey=None, + extra_inputs={ + "files_0|file_type": "txt", + "files_1|url_paste": "SecondOutputContent", + "files_1|NAME": "SecondOutputName", + "files_1|file_type": "txt", + "file_count": "2", + } + ) + run_response = self.dataset_populator.tools_post(payload) + self.dataset_populator.wait_for_tool_run(history_id, run_response) + datasets = run_response.json()["outputs"] + + assert len(datasets) == 2, datasets + content = self.dataset_populator.get_history_dataset_content(history_id, dataset=datasets[0]) + assert content.strip() == "Test123" + assert datasets[0]["file_ext"] == "txt", datasets + assert datasets[0]["genome_build"] == "?", datasets + + content = self.dataset_populator.get_history_dataset_content(history_id, dataset=datasets[1]) + assert content.strip() == "SecondOutputContent" + assert datasets[1]["file_ext"] == "txt" + assert datasets[1]["genome_build"] == "?", datasets + def test_upload_multiple_files_space_to_tab(self): with self.dataset_populator.test_history() as history_id: payload = self.dataset_populator.upload_payload(history_id, diff --git a/test/base/populators.py b/test/base/populators.py index 4860e5bd09f..6ce6ce89553 100644 --- a/test/base/populators.py +++ b/test/base/populators.py @@ -168,6 +168,8 @@ class BaseDatasetPopulator(object): 'dbkey': dbkey, 'file_type': file_type, } + if dbkey is None: + del upload_params["dbkey"] if content is None: upload_params["files_0|ftp_files"] = kwds.get("ftp_files") elif hasattr(content, 'read'):