Unverified Commit e0f4b86a authored by mvdbeek's avatar mvdbeek
Browse files

Use fetch api in api tests

parent 191feb99
Loading
Loading
Loading
Loading
+4 −10
Original line number Diff line number Diff line
@@ -926,13 +926,7 @@ class ToolsUploadTestCase(ApiTestCase):

        with self.dataset_populator.test_history() as history_id:
            session_id = upload_file(url=f"{self.url}/api/upload/resumable_upload", path=TestDataResolver().get_filename("1.fastqsanger.gz"), api_key=self.galaxy_interactor.api_key, history_id=history_id)
            upload_params = {
                'files_0|NAME': '1.fastqsanger.gz',
                'files_0|file_data': json.dumps({'session_id': session_id, 'name': '1.fastqsanger.gz'}),
                'file_type': 'fastqsanger.gz',
            }
            self.dataset_populator.run_tool('upload1', history_id=history_id, inputs=upload_params)
            self.dataset_populator.wait_for_history(history_id, assert_ok=True)
            dataset = self.dataset_populator.get_history_dataset_details(history_id)
            assert dataset['name'] == '1.fastqsanger.gz'
            assert dataset['file_ext'] == 'fastqsanger.gz'
            hda = self._upload_and_get_details(content=json.dumps({'session_id': session_id, 'name': '1.fastqsanger.gz'}), api='fetch', ext='fastqsanger.gz')
            assert hda['name'] == '1.fastqsanger.gz'
            assert hda['file_ext'] == 'fastqsanger.gz'
            assert hda['state'] == 'ok'