| Index: tests/test_parser.py |
| =================================================================== |
| --- a/tests/test_parser.py |
| +++ b/tests/test_parser.py |
| @@ -67,6 +67,47 @@ |
| (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'"), |
| + ], |
| + }, |
| + 'bla$match-case,csp=first csp,script,other,domain=foo.com,sitekey=foo': { |
|
Vasily Kuznetsov
2018/06/08 16:41:48
It seems like this test does more or less the sane
rhowell
2018/06/12 21:13:18
Done.
|
| + 'selector': {'type': ST.URL_PATTERN, 'value': 'bla'}, |
| + 'action': FA.BLOCK, |
| + 'options': [ |
| + ('match-case', True), |
| + ('csp', 'first csp'), |
| + ('script', True), |
| + ('other', True), |
| + ('domain', [('foo.com', True)]), |
| + ('sitekey', ['foo']), |
| + ], |
| + }, |
| + 'bla$~match-case,~csp=csp,~script,~other,~third-party,domain=~bar.com': { |
| + 'selector': {'type': ST.URL_PATTERN, 'value': 'bla'}, |
| + 'action': FA.BLOCK, |
| + 'options': [ |
| + ('match-case', False), |
| + ('csp=csp', False), |
|
Vasily Kuznetsov
2018/06/08 16:41:48
Hm, I think this should be ('csp', False). I guess
rhowell
2018/06/12 21:13:18
Done.
|
| + ('script', False), |
| + ('other', False), |
| + ('third-party', False), |
| + ('domain', [('bar.com', False)]), |
| + ], |
| + }, |
| + '@@bla$script,other,domain=foo.com|~bar.foo.com,csp=c s p': { |
|
Vasily Kuznetsov
2018/06/08 16:41:48
This one adds testing, of a CSP option in an excep
rhowell
2018/06/12 21:13:18
I already combined the first two csp tests, so now
|
| + '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'}, |