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

Unified Diff: tests/test_rpy.py

Issue 30031558: Issue 7391 - Let rpy recursively parse filter options to dicts (Closed) Base URL: https://hg.adblockplus.org/python-abp
Patch Set: Remove all OrderedDicts Created April 12, 2019, 6:30 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/rpy.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/test_rpy.py
===================================================================
--- a/tests/test_rpy.py
+++ b/tests/test_rpy.py
@@ -68,7 +68,7 @@
b'text': b'foo.com##div#ad1',
b'selector': {b'type': b'css', b'value': b'div#ad1'},
b'action': b'hide',
- b'options': [(b'domain', [(b'foo.com', True)])],
+ b'options': {b'domain': {b'foo.com': True}},
},
},
'filter_with_%': {
@@ -79,7 +79,7 @@
b'selector': {b'type': b'url-pattern',
b'value': b'%22banner%*%22idzone%'},
b'action': b'block',
- b'options': [],
+ b'options': {},
},
},
'filter_multiple': {
@@ -89,8 +89,22 @@
b'text': b'foo.com,bar.com##div#ad1',
b'selector': {b'type': b'css', b'value': b'div#ad1'},
b'action': b'hide',
- b'options': [(b'domain', [(b'foo.com', True), (b'bar.com',
- True)])],
+ b'options': {b'domain': {b'foo.com': True, b'bar.com': True}},
+ },
+ },
+ 'filter_with_sitekey_list': {
+ 'in': b'@@bla$ping,domain=foo.com|~bar.foo.com,sitekey=foo|bar',
+ 'out': {
+ b'text':
+ b'@@bla$ping,domain=foo.com|~bar.foo.com,sitekey=foo|bar',
+ b'selector': {b'value': b'bla', b'type': b'url-pattern'},
+ b'action': b'allow',
+ b'options': {
+ b'ping': True,
+ b'domain': {b'foo.com': True,
+ b'bar.foo.com': False},
+ b'sitekey': [b'foo', b'bar']},
+ b'type': b'Filter',
},
},
}
« no previous file with comments | « abp/filters/rpy.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld