aboutsummaryrefslogtreecommitdiff
path: root/test/unit/test_policy_deciding.py
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2022-01-15 12:35:47 +0100
committerWojtek Kosior <koszko@koszko.org>2022-01-15 12:35:47 +0100
commit07a883feeeea63cc23fb5100a0618f29b0a5da9f (patch)
tree87569023aee35929308381344221f68566adc2ac /test/unit/test_policy_deciding.py
parente7d11c7c1173d07db741301053db78b835a73ab3 (diff)
downloadbrowser-extension-07a883feeeea63cc23fb5100a0618f29b0a5da9f.tar.gz
browser-extension-07a883feeeea63cc23fb5100a0618f29b0a5da9f.zip
make blocking rules queryable in pattern tree just as mappings are
Diffstat (limited to 'test/unit/test_policy_deciding.py')
-rw-r--r--test/unit/test_policy_deciding.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/unit/test_policy_deciding.py b/test/unit/test_policy_deciding.py
index a360537..88095af 100644
--- a/test/unit/test_policy_deciding.py
+++ b/test/unit/test_policy_deciding.py
@@ -61,11 +61,11 @@ def test_decide_policy(execute_in_page):
policy = execute_in_page(
'''{
const tree = pqt.make();
- pqt.register(tree, "http://kno.wn", "allowed", {allow: true});
+ pqt.register(tree, "http://kno.wn", "~allow", 1);
returnval(decide_policy(tree, "http://kno.wn/", false, "abcd"));
}''')
assert policy['allow'] == True
- assert policy['mapping'] == 'allowed'
+ assert policy['mapping'] == '~allow'
for prop in ('payload', 'nonce', 'csp'):
assert prop not in policy
@@ -87,11 +87,11 @@ def test_decide_policy(execute_in_page):
policy = execute_in_page(
'''{
const tree = pqt.make();
- pqt.register(tree, "http://kno.wn", "disallowed", {allow: false});
+ pqt.register(tree, "http://kno.wn", "~allow", 0);
returnval(decide_policy(tree, "http://kno.wn/", true, "abcd"));
}''')
assert policy['allow'] == False
- assert policy['mapping'] == 'disallowed'
+ assert policy['mapping'] == '~allow'
for prop in ('payload', 'nonce'):
assert prop not in policy
assert parse_csp(policy['csp']) == {