Unverified Commit cf5d6cec authored by Nicola Soranzo's avatar Nicola Soranzo
Browse files

Fix ``test_storage_show`` API test

Pass hda id instead of dataset id to ``dataset_storage_info()``.

Fix the following traceback:

```
    def test_storage_show(self, history_id):
        hda = self.dataset_populator.new_dataset(history_id, wait=True)
        hda_details = self.dataset_populator.get_history_dataset_details(history_id, dataset=hda)
        dataset_id = hda_details["dataset_id"]
>       storage_info_dict = self.dataset_populator.dataset_storage_info(dataset_id)

...

        if http_error_msg:
>           raise HTTPError(http_error_msg, response=self)
E           requests.exceptions.HTTPError: 404 Client Error: Not Found for url: http://127.0.0.1:9129/api/datasets/9a58064fb2c43d99/storage

http_error_msg = ('404 Client Error: Not Found for url: '
 'http://127.0.0.1:9129/api/datasets/9a58064fb2c43d99/storage')
reason     = 'Not Found'
self       = <Response [404]>
```

Broken since the test was introduced in commit c5bf63bc .

Started failing after https://github.com/galaxyproject/galaxy/pull/19506 ,
but probably just because of database ids changing.
parent 3cf5a45c
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -708,7 +708,6 @@ class TestDatasetsApi(ApiTestCase):
        for purged_source_id in expected_purged_source_ids:
            self.dataset_populator.wait_for_purge(history_id, purged_source_id["id"])

    @requires_new_history
    @requires_new_library
    def test_delete_batch_lddas(self):
        # Create a library dataset
@@ -859,9 +858,7 @@ class TestDatasetsApi(ApiTestCase):

    def test_storage_show(self, history_id):
        hda = self.dataset_populator.new_dataset(history_id, wait=True)
        hda_details = self.dataset_populator.get_history_dataset_details(history_id, dataset=hda)
        dataset_id = hda_details["dataset_id"]
        storage_info_dict = self.dataset_populator.dataset_storage_info(dataset_id)
        storage_info_dict = self.dataset_populator.dataset_storage_info(hda["id"])
        assert_has_keys(storage_info_dict, "object_store_id", "name", "description")

    def test_storage_show_on_discarded(self, history_id):