mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Adjust DatasetsApiTestCase.test_index to status code 200
And modernize test setup by using DatasetPopulator.
This commit is contained in:
@@ -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'
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user