diff options
author | mjk <mjk@disroot.org> | 2022-11-14 19:40:27 +0300 |
---|---|---|
committer | mjk <mjk@disroot.org> | 2022-12-01 00:05:07 +0300 |
commit | b84ef377fedac48fb660406b04f2b9908d86baac (patch) | |
tree | 6f6c94a7855f525117bbf5471190d61365656233 /test | |
parent | 2f8986b3d3b4f83ed942b8f108b62bf9ddf49e53 (diff) |
imprv: Styling: Introduce URI scheme whitelisting
Fixes #11266
Co-authored-by: Philipp Hörist <philipp@hoerist.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/no_gui/test_styling.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/test/no_gui/test_styling.py b/test/no_gui/test_styling.py index 287eac166..8799b8e6e 100644 --- a/test/no_gui/test_styling.py +++ b/test/no_gui/test_styling.py @@ -1,4 +1,5 @@ import unittest +from unittest.mock import MagicMock from gajim import gui gui.init('gtk') @@ -17,6 +18,10 @@ from gajim.common.styling import process_uris from gajim.common.text_helpers import jid_to_iri +app.settings = MagicMock() +app.settings.get.return_value = 'a a- a. scheme' # additional_uri_schemes + + STYLING = { 'pre cannot have children': { 'input': '_no pre `with *children*`_', @@ -427,6 +432,8 @@ UNACCEPTABLE_URIS = [ 'file:a', 'file:a/', 'file:a/b', + + 'mailtomailto:foo@bar.com.uk', ] @@ -495,8 +502,6 @@ NONJIDS = [ URIS_WITH_TEXT = [ ('write to my email mailto:foo@bar.com.uk (but not to mailto:bar@foo.com)', ['mailto:foo@bar.com.uk', 'mailto:bar@foo.com']), - ('write to my email mailtomailto:foo@bar.com.uk (but not to mailto:bar@foo.com)', - ['mailtomailto:foo@bar.com.uk', 'mailto:bar@foo.com']), ('see this http://userid@example.com/ link', ['http://userid@example.com/']), ('see this http://userid@example.com/, and ..', ['http://userid@example.com/']), ('<http://userid@example.com/>', ['http://userid@example.com/']), |