| Left: | ||
| Right: |
| 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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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'] |
| OLD | NEW |