Skip to content

Commit

Permalink
fix: improved inventory test
Browse files Browse the repository at this point in the history
  • Loading branch information
johanneskoester committed Dec 17, 2023
1 parent 89d3635 commit a07d750
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions snakemake_interface_storage_plugins/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ def test_storage(self, tmp_path):
obj.local_path().unlink()

assert obj.exists()
print(obj.mtime())
print(obj.size())

self._test_inventory(obj)

if not self.store_only:
obj.local_path().parent.mkdir(parents=True, exist_ok=True)
Expand All @@ -79,9 +79,13 @@ def test_storage_not_existing(self, tmp_path):

assert not obj.exists()

def test_inventory(self, tmp_path):
obj = self._get_obj(tmp_path, self.get_query(tmp_path))
def _test_inventory(self, obj):
cache = IOCache(max_wait_time=10)
# create inventory entry if implemented in StorageObject
asyncio.run(obj.inventory(cache))
# Check whether second run of inventory passes (should not perform any action
# though)
# TODO: Mock the cache to make sure that no second storing happens
asyncio.run(obj.inventory(cache))

def test_query_validation(self, tmp_path):
Expand Down

0 comments on commit a07d750

Please sign in to comment.