Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion paths_cli/commands/contents.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@ def contents(input_file, table):
command (i.e., to identify exactly how a state or engine is named.)
"""
storage = INPUT_FILE.get(input_file)
print(storage)
try:
print(storage.filename)
except AttributeError: # no-cov (temporary fix)
# TODO: this should be removed once SimStore has a `filename`
# attribute
print(storage)
if table is None:
report_all_tables(storage)
else:
Expand Down
8 changes: 4 additions & 4 deletions paths_cli/tests/commands/test_contents.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def test_contents(tps_fixture):
results = runner.invoke(contents, ['setup.nc'])
cwd = os.getcwd()
expected = [
f"Storage @ '{cwd}/setup.nc'",
f"{cwd}/setup.nc",
"CVs: 1 item", "* x",
"Volumes: 8 items", "* A", "* B", "* plus 6 unnamed items",
"Engines: 2 items", "* flat", "* plus 1 unnamed item",
Expand Down Expand Up @@ -56,17 +56,17 @@ def test_contents_table(tps_fixture, table):
cwd = os.getcwd()
expected = {
'volumes': [
f"Storage @ '{cwd}/setup.nc'",
f"{cwd}/setup.nc",
"volumes: 8 items", "* A", "* B", "* plus 6 unnamed items",
""
],
'trajectories': [
f"Storage @ '{cwd}/setup.nc'",
f"{cwd}/setup.nc",
"trajectories: 1 unnamed item",
""
],
'tags': [
f"Storage @ '{cwd}/setup.nc'",
f"{cwd}/setup.nc",
"tags: 1 item",
"* initial_conditions",
""
Expand Down