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: Created May 29, 2018, 4:54 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
« abp/filters/parser.py ('K') | « 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,13 @@
(OPT.SITEKEY, ['foo', 'bar']),
],
},
+ "||foo.com^$csp=script-src 'self' * 'unsafe-inline'": {
+ 'selector': {'type': ST.URL_PATTERN, 'value': '||foo.com^'},
+ 'action': FA.BLOCK,
+ 'options': [
+ (OPT.CSP, "script-src 'self' * 'unsafe-inline'"),
+ ],
+ },
# Element hiding filters and exceptions.
'##ddd': {
'selector': {'type': ST.CSS, 'value': 'ddd'},
@@ -103,6 +110,7 @@
}.items())
def test_parse_filters(filter_text, expected):
"""Parametric test for filter parsing."""
+ # from pdb import set_trace; set_trace()
Vasily Kuznetsov 2018/05/30 19:49:26 ;)
rhowell 2018/06/07 18:16:55 oops! Done. :)
parsed = parse_line(filter_text)
assert parsed.type == 'filter'
assert parsed.text == filter_text
« abp/filters/parser.py ('K') | « abp/filters/parser.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld