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:
parent
8e3465b5d4
commit
180e96b332
10 changed files with 36 additions and 37 deletions
|
@ -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)
|
||||
|
||||
|
|
|
@ -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/")
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue