1
0
Fork 0
mirror of https://github.com/Kozea/Radicale.git synced 2025-09-18 20:46:54 +00:00

Move internal options to other sections

This commit is contained in:
Unrud 2020-02-19 09:50:36 +01:00
parent 8e3465b5d4
commit 180e96b332
10 changed files with 36 additions and 37 deletions

View file

@ -42,9 +42,9 @@ class TestBaseAuthRequests(BaseTest):
self.configuration = config.load()
self.colpath = tempfile.mkdtemp()
self.configuration.update({
"storage": {"filesystem_folder": self.colpath},
# Disable syncing to disk for better performance
"_internal": {"filesystem_fsync": "False"},
"storage": {"filesystem_folder": self.colpath,
# Disable syncing to disk for better performance
"_filesystem_fsync": "False"},
# Set incorrect authentication delay to a very low value
"auth": {"delay": "0.002"}}, "test", privileged=True)

View file

@ -1348,9 +1348,9 @@ collection: .*
permissions: RrWw""")
self.configuration.update({
"storage": {"type": self.storage_type,
"filesystem_folder": self.colpath},
# Disable syncing to disk for better performance
"_internal": {"filesystem_fsync": "False"},
"filesystem_folder": self.colpath,
# Disable syncing to disk for better performance
"_filesystem_fsync": "False"},
"rights": {"file": rights_file_path,
"type": "from_file"}}, "test", privileged=True)
self.application = Application(self.configuration)
@ -1373,7 +1373,7 @@ class TestMultiFileSystem(BaseFileSystemTest, BaseRequestsMixIn):
def test_fsync(self):
"""Create a directory and file with syncing enabled."""
self.configuration.update({"_internal": {"filesystem_fsync": "True"}},
self.configuration.update({"storage": {"_filesystem_fsync": "True"}},
"test", privileged=True)
self.application = Application(self.configuration)
self.mkcalendar("/calendar.ics/")

View file

@ -131,15 +131,15 @@ class TestConfig:
assert "section 'server" in str(e)
assert "'x'" in str(e)
def test_internal(self):
def test_privileged(self):
configuration = config.load()
configuration.update({"_internal": {"internal_server": "True"}},
configuration.update({"server": {"_internal_server": "True"}},
"test", privileged=True)
with pytest.raises(Exception) as exc_info:
configuration.update(
{"_internal": {"internal_server": "True"}}, "test")
{"server": {"_internal_server": "True"}}, "test")
e = exc_info.value
assert "Invalid section '_internal'" in str(e)
assert "Invalid option '_internal_server'" in str(e)
def test_plugin_schema(self):
plugin_schema = {"auth": {"new_option": {"value": "False",

View file

@ -35,9 +35,9 @@ class TestBaseRightsRequests(BaseTest):
self.configuration = config.load()
self.colpath = tempfile.mkdtemp()
self.configuration.update({
"storage": {"filesystem_folder": self.colpath},
# Disable syncing to disk for better performance
"_internal": {"filesystem_fsync": "False"}},
"storage": {"filesystem_folder": self.colpath,
# Disable syncing to disk for better performance
"_filesystem_fsync": "False"}},
"test", privileged=True)
def teardown(self):

View file

@ -63,12 +63,12 @@ class TestBaseServerRequests(BaseTest):
sock.bind(("127.0.0.1", 0))
self.sockname = sock.getsockname()
self.configuration.update({
"storage": {"filesystem_folder": self.colpath},
"storage": {"filesystem_folder": self.colpath,
# Disable syncing to disk for better performance
"_filesystem_fsync": "False"},
"server": {"hosts": "[%s]:%d" % self.sockname},
# Enable debugging for new processes
"logging": {"level": "debug"},
# Disable syncing to disk for better performance
"_internal": {"filesystem_fsync": "False"}},
"logging": {"level": "debug"}},
"test", privileged=True)
self.thread = threading.Thread(target=server.serve, args=(
self.configuration, shutdown_socket_out))

View file

@ -33,9 +33,9 @@ class TestBaseWebRequests(BaseTest):
self.configuration = config.load()
self.colpath = tempfile.mkdtemp()
self.configuration.update({
"storage": {"filesystem_folder": self.colpath},
# Disable syncing to disk for better performance
"_internal": {"filesystem_fsync": "False"}},
"storage": {"filesystem_folder": self.colpath,
# Disable syncing to disk for better performance
"_filesystem_fsync": "False"}},
"test", privileged=True)
self.application = Application(self.configuration)