From 95fe0ffcf5625078a677f9547dedfac80f1817ad Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Tue, 16 Apr 2019 12:08:57 +0200 Subject: [PATCH] Adjust DatasetsApiTestCase.test_index to status code 200 And modernize test setup by using DatasetPopulator. --- test/api/test_datasets.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/test/api/test_datasets.py b/test/api/test_datasets.py index ab4df66bc5d..581533bf277 100644 --- a/test/api/test_datasets.py +++ b/test/api/test_datasets.py @@ -3,21 +3,22 @@ from __future__ import print_function import textwrap from base import api -from base.populators import TestsDatasets +from base.populators import DatasetPopulator -class DatasetsApiTestCase(api.ApiTestCase, TestsDatasets): +class DatasetsApiTestCase(api.ApiTestCase): def setUp(self): super(DatasetsApiTestCase, self).setUp() - self.history_id = self._new_history() + self.dataset_populator = DatasetPopulator(self.galaxy_interactor) + self.history_id = self.dataset_populator.new_history() def test_index(self): index_response = self._get("datasets") - self._assert_status_code_is(index_response, 501) + self._assert_status_code_is(index_response, 200) def test_show(self): - hda1 = self._new_dataset(self.history_id) + hda1 = self.dataset_populator.new_dataset(self.history_id) show_response = self._get("datasets/%s" % (hda1["id"])) self._assert_status_code_is(show_response, 200) self.__assert_matches_hda(hda1, show_response.json()) @@ -33,8 +34,8 @@ class DatasetsApiTestCase(api.ApiTestCase, TestsDatasets): A B C D 10 20 30 40 """) - hda1 = self._new_dataset(self.history_id, content=contents) - self._wait_for_history(self.history_id) + hda1 = self.dataset_populator.new_dataset(self.history_id, content=contents) + self.dataset_populator.wait_for_history(self.history_id) display_response = self._get("histories/%s/contents/%s/display" % (self.history_id, hda1["id"]), { 'raw': 'True' })