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

Side by Side Diff: tests/test_rpy.py

Issue 29880577: Issue 6877 - Only parse headers in the first line of the filter list (Closed)
Patch Set: Correct behavior, add comments, improve naming, add tests Created Sept. 18, 2018, 12:37 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« abp/filters/parser.py ('K') | « tests/test_parser.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # This file is part of Adblock Plus <https://adblockplus.org/>, 1 # This file is part of Adblock Plus <https://adblockplus.org/>,
2 # Copyright (C) 2006-present eyeo GmbH 2 # Copyright (C) 2006-present eyeo GmbH
3 # 3 #
4 # Adblock Plus is free software: you can redistribute it and/or modify 4 # Adblock Plus is free software: you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License version 3 as 5 # it under the terms of the GNU General Public License version 3 as
6 # published by the Free Software Foundation. 6 # published by the Free Software Foundation.
7 # 7 #
8 # Adblock Plus is distributed in the hope that it will be useful, 8 # Adblock Plus is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 data = line2dict(_TEST_EXAMPLES[line_type]['in']) 128 data = line2dict(_TEST_EXAMPLES[line_type]['in'])
129 check_data_utf8(data) 129 check_data_utf8(data)
130 130
131 131
132 @pytest.mark.parametrize('line_type', list(_TEST_EXAMPLES.keys())) 132 @pytest.mark.parametrize('line_type', list(_TEST_EXAMPLES.keys()))
133 def test_line2dict_format(line_type): 133 def test_line2dict_format(line_type):
134 """Test that the API result has the appropriate format. 134 """Test that the API result has the appropriate format.
135 135
136 Checks for both keys and datatypes. 136 Checks for both keys and datatypes.
137 """ 137 """
138 data = line2dict(_TEST_EXAMPLES[line_type]['in']) 138 mode = 'start' if line_type == 'header' else 'body'
139 data = line2dict(_TEST_EXAMPLES[line_type]['in'], mode)
Sebastian Noack 2018/09/18 15:19:08 Note that I removed the test case for metadata her
Vasily Kuznetsov 2018/09/18 18:11:44 Done.
139 140
140 assert data == _TEST_EXAMPLES[line_type]['out'] 141 assert data == _TEST_EXAMPLES[line_type]['out']
OLDNEW
« abp/filters/parser.py ('K') | « tests/test_parser.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld