aboutsummaryrefslogtreecommitdiff
path: root/test/unit/test_patterns.py
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2021-12-14 21:40:23 +0100
committerWojtek Kosior <koszko@koszko.org>2021-12-14 22:06:58 +0100
commit58fe4c7d806359bed299f74ba56902ab396a6ed1 (patch)
tree38cc0620fe36c5bd7ef7df7dd9f24d332a51fdee /test/unit/test_patterns.py
parent79446ca52cea0864ebe2540ba774cc386ee2f8bc (diff)
downloadbrowser-extension-58fe4c7d806359bed299f74ba56902ab396a6ed1.tar.gz
browser-extension-58fe4c7d806359bed299f74ba56902ab396a6ed1.zip
facilitate broadcasting messages to different execution contexts within the webextension
Diffstat (limited to 'test/unit/test_patterns.py')
-rw-r--r--test/unit/test_patterns.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/unit/test_patterns.py b/test/unit/test_patterns.py
index 802bf4e..99e1ed5 100644
--- a/test/unit/test_patterns.py
+++ b/test/unit/test_patterns.py
@@ -25,12 +25,13 @@ from ..script_loader import load_script
def patterns_code():
yield load_script('common/patterns.js', ['common'])
+@pytest.mark.get_page('https://gotmyowndoma.in')
def test_regexes(execute_in_page, patterns_code):
"""
patterns.js contains regexes used for URL parsing.
Verify they work properly.
"""
- execute_in_page(patterns_code, page='https://gotmyowndoma.in')
+ execute_in_page(patterns_code)
valid_url = 'https://example.com/a/b?ver=1.2.3#heading2'
valid_url_rest = 'example.com/a/b?ver=1.2.3#heading2'
@@ -90,12 +91,13 @@ def test_regexes(execute_in_page, patterns_code):
'@bad.url/')
assert match is None
+@pytest.mark.get_page('https://gotmyowndoma.in')
def test_deconstruct_url(execute_in_page, patterns_code):
"""
patterns.js contains deconstruct_url() function that handles URL parsing.
Verify it works properly.
"""
- execute_in_page(patterns_code, page='https://gotmyowndoma.in')
+ execute_in_page(patterns_code)
deco = execute_in_page('returnval(deconstruct_url(arguments[0]));',
'https://eXaMpLe.com/a/b?ver=1.2.3#heading2')