mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
config: Add user websites as choices for homepage config.
Closes: #1981 Closes also most of threads in !1952. Signed-off-by: Fioddor Superconcentrado <fioddor@gmail.com> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
1 parent
f527d9af83
commit
337e8c28dd
8 files changed
+323
-32
No files matched your search
@@ -72,6 +72,7 @@ def test_webserver_disable(superuser_run):
|
||||
@patch('plinth.modules.apache.components.diagnose_url_on_all')
|
||||
def test_webserver_diagnose(diagnose_url_on_all, diagnose_url):
|
||||
"""Test running diagnostics."""
|
||||
|
||||
def on_all_side_effect(url, check_certificate):
|
||||
return [('test-result-' + url, 'success')]
|
||||
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
"""
|
||||
Test module for (U)ser (Web) (S)ites.
|
||||
"""
|
||||
|
||||
from plinth.modules.apache import (uws_usr2dir, uws_dir2url, uws_url2usr,
|
||||
uws_usr2url, uws_url2dir, uws_dir2usr)
|
||||
|
||||
|
||||
def test_uws_namings():
|
||||
"""Test name solvers for user, url and directory of UWS."""
|
||||
|
||||
assert '/home/usr/public_html' == uws_usr2dir('usr')
|
||||
assert '/~usr/' == uws_usr2url('usr')
|
||||
|
||||
f = uws_dir2usr
|
||||
assert f('/home/usr/lacks/the/UWS/directory') is None
|
||||
assert 'usr' == f('/home/usr/public_html/is/a/normal/UWS/file')
|
||||
assert 'usr' == f('/home/usr/public_html/is/a/normal/UWS/path/')
|
||||
assert '€.;#@|' == f('/home/€.;#@|/public_html/is/stange/but/valid/')
|
||||
|
||||
f = uws_url2usr
|
||||
assert f('/usr/is/not/a/valid/UWS/url/due/to/missing/tilde') is None
|
||||
assert 'usr' == f('whatever/~usr/is/considered/a/valid/UWS/path')
|
||||
assert 'usr' == f('~usr')
|
||||
assert 'usr' == f('~usr/')
|
||||
assert 'usr' == f('/~usr/')
|
||||
|
||||
assert '/home/usr/public_html' == uws_url2dir('~usr/any/file')
|
||||
assert '/~usr/' == uws_dir2url('/home/usr/public_html/path/to/file')
|
||||
Reference in new issue
Block a user