Skip to content

Commit

Permalink
Update usage in get_filepaths, and test it.
Browse files Browse the repository at this point in the history
  • Loading branch information
danielballan committed Feb 7, 2024
1 parent d023d6b commit ed34357
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions tiled/_tests/test_asset_access.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

from ..catalog import in_memory
from ..client import Context, from_context
from ..client.utils import get_filepaths
from ..server.app import build_app
from ..utils import path_from_uri

Expand Down Expand Up @@ -61,3 +62,8 @@ def test_raw_export(client, tmpdir):
hashlib.md5(path.read_bytes()).digest() for path in exported_paths
]
assert orig_hashes == exported_hashes


def test_get_filepaths(client):
client.write_array([1, 2, 3], key="x")
get_filepaths(client["x"])
2 changes: 1 addition & 1 deletion tiled/client/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ def get_filepaths(node):
Given a node, return a list of filepaths of the data backing it.
"""
filepaths = []
for data_source in node.include_data_sources().data_sources or []:
for data_source in node.data_sources() or []:
for asset in data_source["assets"]:
# If, in the future, there are nodes with s3:// or other
# schemes, path_from_uri will raise an exception here
Expand Down

0 comments on commit ed34357

Please sign in to comment.