Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: tests/test_parser.py

Issue 29793573: Issue 6701 - Implement CSP support in python-abp (Closed) Base URL: https://hg.adblockplus.org/python-abp/
Patch Set: Removing handling and testing for ~csp Created June 14, 2018, 7:48 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « abp/filters/parser.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/test_parser.py
===================================================================
--- a/tests/test_parser.py
+++ b/tests/test_parser.py
@@ -67,6 +67,29 @@
(OPT.SITEKEY, ['foo', 'bar']),
],
},
+ "||foo.com^$csp=script-src 'self' * 'unsafe-inline',script,sitekey=foo," +
+ 'other,match-case,domain=foo.com': {
+ 'selector': {'type': ST.URL_PATTERN, 'value': '||foo.com^'},
+ 'action': FA.BLOCK,
+ 'options': [
+ (OPT.CSP, "script-src 'self' * 'unsafe-inline'"),
+ ('script', True),
+ ('sitekey', ['foo']),
+ ('other', True),
+ ('match-case', True),
+ ('domain', [('foo.com', True)]),
+ ],
+ },
+ '@@bla$script,other,domain=foo.com|~bar.foo.com,csp=c s p': {
+ 'selector': {'type': ST.URL_PATTERN, 'value': 'bla'},
+ 'action': FA.ALLOW,
+ 'options': [
+ ('script', True),
+ ('other', True),
+ ('domain', [('foo.com', True), ('bar.foo.com', False)]),
+ ('csp', 'c s p'),
+ ],
+ },
# Element hiding filters and exceptions.
'##ddd': {
'selector': {'type': ST.CSS, 'value': 'ddd'},
« no previous file with comments | « abp/filters/parser.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld