2015-09-28 22:07:26 +02:00
|
|
|
import pytest
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.usefixtures("resetSettings")
|
|
|
|
class TestSiteStorage:
|
2017-02-25 05:47:38 +01:00
|
|
|
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"]
|
|
|
|
|
2015-09-28 22:07:26 +02:00
|
|
|
def testList(self, site):
|
Rev467, requirements.txt accept newer dependecies, Boost dbschema.json, Move getDirname getFilename to helper, Verify optional files, Includes not allowed in user files, Optional files rules, Peer hashfield functions, Test optional files signing, Test file info, Test verify file, Test helpers
2015-10-01 01:35:13 +02:00
|
|
|
# Rootdir
|
|
|
|
list_root = list(site.storage.list(""))
|
|
|
|
assert "content.json" in list_root
|
2017-02-25 05:47:38 +01:00
|
|
|
assert "css/all.css" not in list_root
|
2015-09-28 22:07:26 +02:00
|
|
|
|
Rev467, requirements.txt accept newer dependecies, Boost dbschema.json, Move getDirname getFilename to helper, Verify optional files, Includes not allowed in user files, Optional files rules, Peer hashfield functions, Test optional files signing, Test file info, Test verify file, Test helpers
2015-10-01 01:35:13 +02:00
|
|
|
# Subdir
|
2017-12-15 01:58:57 +01:00
|
|
|
assert set(site.storage.list("data-default")) == set(["data.json", "users"])
|
2019-06-23 14:21:50 +02:00
|
|
|
|
|
|
|
def testDbRebuild(self, site):
|
|
|
|
assert site.storage.rebuildDb()
|