rename SiteStorage.list to SiteStorage.walk
also, add SiteStorage.list as non-recursive directory listing (`os.listdir`)
This commit is contained in:
parent
4d3603136f
commit
656c818211
5 changed files with 24 additions and 6 deletions
|
@ -3,11 +3,20 @@ import pytest
|
|||
|
||||
@pytest.mark.usefixtures("resetSettings")
|
||||
class TestSiteStorage:
|
||||
def testWalk(self, site):
|
||||
# Rootdir
|
||||
walk_root = list(site.storage.walk(""))
|
||||
assert "content.json" in walk_root
|
||||
assert "css/all.css" in walk_root
|
||||
|
||||
# Subdir
|
||||
assert list(site.storage.walk("data-default")) == ["data.json", "users/content-default.json"]
|
||||
|
||||
def testList(self, site):
|
||||
# Rootdir
|
||||
list_root = list(site.storage.list(""))
|
||||
assert "content.json" in list_root
|
||||
assert "css/all.css" in list_root
|
||||
assert "css/all.css" not in list_root
|
||||
|
||||
# Subdir
|
||||
assert list(site.storage.list("data-default")) == ["data.json", "users/content-default.json"]
|
||||
assert list(site.storage.list("data-default")) == ["data.json", "users"]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue