TestSiteStorage.py 667 B

12345678910111213141516171819202122
  1. import pytest
  2. @pytest.mark.usefixtures("resetSettings")
  3. class TestSiteStorage:
  4. def testWalk(self, site):
  5. # Rootdir
  6. walk_root = list(site.storage.walk(""))
  7. assert "content.json" in walk_root
  8. assert "css/all.css" in walk_root
  9. # Subdir
  10. assert list(site.storage.walk("data-default")) == ["data.json", "users/content-default.json"]
  11. def testList(self, site):
  12. # Rootdir
  13. list_root = list(site.storage.list(""))
  14. assert "content.json" in list_root
  15. assert "css/all.css" not in list_root
  16. # Subdir
  17. assert list(site.storage.list("data-default")) == ["data.json", "users"]