OLD | NEW |
1 # This file is part of the Adblock Plus web scripts, | 1 # This file is part of the Adblock Plus web scripts, |
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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 ('3', '\nseverity = normal\n'), | 147 ('3', '\nseverity = normal\n'), |
148 ('4', '\nseverity = relentless\n'), | 148 ('4', '\nseverity = relentless\n'), |
149 ] | 149 ] |
150 notifications = parser.load_notifications() | 150 notifications = parser.load_notifications() |
151 self.assertEqual(len(notifications), 4) | 151 self.assertEqual(len(notifications), 4) |
152 self.assertEqual(notifications[0]['severity'], 'information') | 152 self.assertEqual(notifications[0]['severity'], 'information') |
153 self.assertEqual(notifications[1]['severity'], 'critical') | 153 self.assertEqual(notifications[1]['severity'], 'critical') |
154 self.assertEqual(notifications[2]['severity'], 'normal') | 154 self.assertEqual(notifications[2]['severity'], 'normal') |
155 self.assertEqual(notifications[3]['severity'], 'relentless') | 155 self.assertEqual(notifications[3]['severity'], 'relentless') |
156 | 156 |
| 157 def test_urls(self): |
| 158 self.notification_to_load = [ |
| 159 ('1', '\nurls = adblockplus.org\n'), |
| 160 ('1', '\nurls = adblockplus.org eyeo.com\n'), |
| 161 ] |
| 162 notifications = parser.load_notifications() |
| 163 |
| 164 assert len(notifications) == 2 |
| 165 assert notifications[0]['urlFilters'] == ['ADBLOCKPLUS.ORG^$document'] |
| 166 assert notifications[1]['urlFilters'] == [ |
| 167 'ADBLOCKPLUS.ORG^$document', |
| 168 'EYEO.COM^$document'] |
| 169 |
157 | 170 |
158 if __name__ == '__main__': | 171 if __name__ == '__main__': |
159 unittest.main() | 172 unittest.main() |
OLD | NEW |