summaryrefslogtreecommitdiff
path: root/test/unit/test_patterns_query_tree.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_query_tree.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_query_tree.py')
-rw-r--r--test/unit/test_patterns_query_tree.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/test/unit/test_patterns_query_tree.py b/test/unit/test_patterns_query_tree.py
index e282592..a67e22f 100644
--- a/test/unit/test_patterns_query_tree.py
+++ b/test/unit/test_patterns_query_tree.py
@@ -25,13 +25,14 @@ from ..script_loader import load_script
def patterns_tree_code():
yield load_script('common/patterns_query_tree.js', ['common'])
+@pytest.mark.get_page('https://gotmyowndoma.in')
def test_modify_branch(execute_in_page, patterns_tree_code):
"""
patterns_query_tree.js contains Pattern Tree data structure that allows
arrays of string labels to be mapped to items.
Verify operations modifying a single branch of such tree work properly.
"""
- execute_in_page(patterns_tree_code, page='https://gotmyowndoma.in')
+ execute_in_page(patterns_tree_code)
execute_in_page(
'''
let items_added;
@@ -195,13 +196,14 @@ def test_modify_branch(execute_in_page, patterns_tree_code):
}
}
+@pytest.mark.get_page('https://gotmyowndoma.in')
def test_search_branch(execute_in_page, patterns_tree_code):
"""
patterns_query_tree.js contains Pattern Tree data structure that allows
arrays of string labels to be mapped to items.
Verify searching a single branch of such tree work properly.
"""
- execute_in_page(patterns_tree_code, page='https://gotmyowndoma.in')
+ execute_in_page(patterns_tree_code)
execute_in_page(
'''
const item_adder = item => (array => [...(array || []), item]);
@@ -282,13 +284,14 @@ def test_search_branch(execute_in_page, patterns_tree_code):
'\nresult:', result, file=sys.stderr)
raise e from None
+@pytest.mark.get_page('https://gotmyowndoma.in')
def test_pattern_tree(execute_in_page, patterns_tree_code):
"""
patterns_query_tree.js contains Pattern Tree data structure that allows
arrays of string labels to be mapped to items.
Verify operations on entire such tree work properly.
"""
- execute_in_page(patterns_tree_code, page='https://gotmyowndoma.in')
+ execute_in_page(patterns_tree_code)
# Perform tests with all possible patterns for a simple URL.
url = 'https://example.com'