Skip to content

Commit

Permalink
Fix test_storage_show API test
Browse files Browse the repository at this point in the history
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 c5bf63b .

Started failing after #19506 ,
but probably just because of database ids changing.
  • Loading branch information
nsoranzo committed Feb 3, 2025
1 parent 3cf5a45 commit cf5d6ce
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/galaxy_test/api/test_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,6 @@ def test_delete_batch(self):
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
Expand Down Expand Up @@ -859,9 +858,7 @@ def assert_hash_value(self, dataset_details, expected_hash_value, hash_function,

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):
Expand Down

0 comments on commit cf5d6ce

Please sign in to comment.