Adjust DatasetsApiTestCase.test_index to status code 200

And modernize test setup by using DatasetPopulator.
This commit is contained in:
mvdbeek
2019-04-16 19:31:03 +02:00
parent 234193889e
commit 95fe0ffcf5
+8 -7
View File
@@ -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'
})