| OLD | NEW |
| 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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 def test_parse_filterlist(): | 153 def test_parse_filterlist(): |
| 154 result = parse_filterlist(['! foo', '! Title: bar']) | 154 result = parse_filterlist(['! foo', '! Title: bar']) |
| 155 assert list(result) == [Comment('foo'), Metadata('Title', 'bar')] | 155 assert list(result) == [Comment('foo'), Metadata('Title', 'bar')] |
| 156 | 156 |
| 157 | 157 |
| 158 def test_exception_timing(): | 158 def test_exception_timing(): |
| 159 result = parse_filterlist(['! good line', '%bad line%']) | 159 result = parse_filterlist(['! good line', '%bad line%']) |
| 160 assert next(result) == Comment('good line') | 160 assert next(result) == Comment('good line') |
| 161 with pytest.raises(ParseError): | 161 with pytest.raises(ParseError): |
| 162 next(result) | 162 next(result) |
| 163 |
| 164 |
| 165 def test_parse_line_bytes(): |
| 166 line = parse_line(b'! \xc3\xbc') |
| 167 assert line.text == '\xfc' |
| OLD | NEW |