| Left: | ||
| Right: |
| LEFT | RIGHT |
|---|---|
| 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 155 self.assertEqual(notifications[3]['severity'], 'relentless') | 155 self.assertEqual(notifications[3]['severity'], 'relentless') |
| 156 | 156 |
| 157 def test_urls(self): | 157 def test_urls(self): |
| 158 self.notification_to_load = [ | 158 self.notification_to_load = [ |
| 159 ('1', '\nurls = adblockplus.org\n'), | 159 ('1', '\nurls = adblockplus.org\n'), |
| 160 ('1', '\nurls = adblockplus.org eyeo.com\n'), | 160 ('1', '\nurls = adblockplus.org eyeo.com\n'), |
| 161 ] | 161 ] |
| 162 notifications = parser.load_notifications() | 162 notifications = parser.load_notifications() |
| 163 | 163 |
| 164 assert len(notifications) == 2 | 164 assert len(notifications) == 2 |
| 165 | 165 assert notifications[0]['urlFilters'] == ['ADBLOCKPLUS.ORG^$document'] |
| 166 self.assertEqual( | 166 assert notifications[1]['urlFilters'] == [ |
|
Vasily Kuznetsov
2017/09/21 09:44:10
These following two asserts would look even better
wspee
2017/09/21 10:11:34
Done.
| |
| 167 notifications[0]['urlFilters'], ['ADBLOCKPLUS.ORG^$document']) | |
| 168 self.assertEqual(notifications[1]['urlFilters'], [ | |
| 169 'ADBLOCKPLUS.ORG^$document', | 167 'ADBLOCKPLUS.ORG^$document', |
| 170 'EYEO.COM^$document']) | 168 'EYEO.COM^$document'] |
| 171 | 169 |
| 172 | 170 |
| 173 if __name__ == '__main__': | 171 if __name__ == '__main__': |
| 174 unittest.main() | 172 unittest.main() |
| LEFT | RIGHT |