OLD | NEW |
1 # coding: utf-8 | 1 # coding: utf-8 |
2 | 2 |
3 # This file is part of the Adblock Plus web scripts, | 3 # This file is part of the Adblock Plus web scripts, |
4 # Copyright (C) 2006-2013 Eyeo GmbH | 4 # Copyright (C) 2006-2013 Eyeo GmbH |
5 # | 5 # |
6 # Adblock Plus is free software: you can redistribute it and/or modify | 6 # Adblock Plus is free software: you can redistribute it and/or modify |
7 # it under the terms of the GNU General Public License version 3 as | 7 # it under the terms of the GNU General Public License version 3 as |
8 # published by the Free Software Foundation. | 8 # published by the Free Software Foundation. |
9 # | 9 # |
10 # Adblock Plus is distributed in the hope that it will be useful, | 10 # Adblock Plus is distributed in the hope that it will be useful, |
(...skipping 12 matching lines...) Expand all Loading... |
23 longMessage = True | 23 longMessage = True |
24 maxDiff = None | 24 maxDiff = None |
25 | 25 |
26 def test_uaparsing(self): | 26 def test_uaparsing(self): |
27 tests = [ | 27 tests = [ |
28 ("Firefox", "25.0", "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gec
ko/20130730 Firefox/25.0"), | 28 ("Firefox", "25.0", "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gec
ko/20130730 Firefox/25.0"), |
29 ("Firefox", "25.0", "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:28.0) Gec
ko/20130730 Firefox/25.0"), | 29 ("Firefox", "25.0", "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:28.0) Gec
ko/20130730 Firefox/25.0"), |
30 ("Firefox", "25.0", "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0.1) G
ecko/20130730 Firefox/25.0.1"), | 30 ("Firefox", "25.0", "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0.1) G
ecko/20130730 Firefox/25.0.1"), |
31 ("Firefox Mobile", "15.0", "Mozilla/5.0 (Maemo; Mobile; rv:15.0) Gecko/201
20829 Firefox/15.0 Fennec/15.0"), | 31 ("Firefox Mobile", "15.0", "Mozilla/5.0 (Maemo; Mobile; rv:15.0) Gecko/201
20829 Firefox/15.0 Fennec/15.0"), |
32 ("Firefox Mobile", "14.0", "Mozilla/5.0 (Android; Mobile; rv:14.0) Gecko/1
4.0 Firefox/14.0a2"), | 32 ("Firefox Mobile", "14.0", "Mozilla/5.0 (Android; Mobile; rv:14.0) Gecko/1
4.0 Firefox/14.0a2"), |
| 33 ("Firefox Tablet", "26.0", "Mozilla/5.0 (Android; Tablet; rv:26.0) Gecko/2
6.0 Firefox/26.0"), |
33 ("Thunderbird", "24.0", "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Geck
o/20100101 Thunderbird/24.0a2 Lightning/2.6a2"), | 34 ("Thunderbird", "24.0", "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Geck
o/20100101 Thunderbird/24.0a2 Lightning/2.6a2"), |
34 ("SeaMonkey", "2.19", "Mozilla/5.0 (Windows NT 5.1; rv:22.0) Gecko/2010010
1 Firefox/22.0 SeaMonkey/2.19"), | 35 ("SeaMonkey", "2.19", "Mozilla/5.0 (Windows NT 5.1; rv:22.0) Gecko/2010010
1 Firefox/22.0 SeaMonkey/2.19"), |
35 ("K-Meleon", "1.5", "Mozilla/5.0 (Windows; U; Windows NT 6.1; ru-RU; rv:1.
8.1.24pre) Gecko/20100228 K-Meleon/1.5.4"), | 36 ("K-Meleon", "1.5", "Mozilla/5.0 (Windows; U; Windows NT 6.1; ru-RU; rv:1.
8.1.24pre) Gecko/20100228 K-Meleon/1.5.4"), |
36 ("Prism", "1.0", "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2
.20) Gecko/20110803 Prism/1.0b4"), | 37 ("Prism", "1.0", "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2
.20) Gecko/20110803 Prism/1.0b4"), |
37 ("Gecko", "22.0", "Mozilla/5.0 (Windows NT 5.1; rv:22.0) Gecko/20100101 Fo
oBar/1.0"), | 38 ("Gecko", "22.0", "Mozilla/5.0 (Windows NT 5.1; rv:22.0) Gecko/20100101 Fo
oBar/1.0"), |
38 ("Opera", "11.10", "Opera/9.80 (Android; Opera Mini/15.0.1162/30.3558; U;
it) Presto/2.8.119 Version/11.10"), | 39 ("Opera", "11.10", "Opera/9.80 (Android; Opera Mini/15.0.1162/30.3558; U;
it) Presto/2.8.119 Version/11.10"), |
39 ("Opera", "9.80", "Opera/9.80 (Android; Opera Mini/15.0.1162/30.3558; U; i
t) Presto/2.8.119"), | 40 ("Opera", "9.80", "Opera/9.80 (Android; Opera Mini/15.0.1162/30.3558; U; i
t) Presto/2.8.119"), |
40 ("Opera", "15.0", "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/28.0.1500.72 Safari/537.36 OPR/15.0.1147.148"), | 41 ("Opera", "15.0", "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/28.0.1500.72 Safari/537.36 OPR/15.0.1147.148"), |
41 ("Chrome", "28.0", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/28.0.1500.72 Safari/537.36"), | 42 ("Chrome", "28.0", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/28.0.1500.72 Safari/537.36"), |
42 ("Chrome", "28.0", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36
(KHTML, like Gecko) Iron/28.0.1550.0 Chrome/28.0.1550.0 Safari/537.36"), | 43 ("Chrome", "28.0", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36
(KHTML, like Gecko) Iron/28.0.1550.0 Chrome/28.0.1550.0 Safari/537.36"), |
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
654 "addonName": {"bar": {"hits": 1, "bandwidth": 200}} | 655 "addonName": {"bar": {"hits": 1, "bandwidth": 200}} |
655 }, | 656 }, |
656 ), | 657 ), |
657 ] | 658 ] |
658 for info, section, ignored_fields, expected_result in tests: | 659 for info, section, ignored_fields, expected_result in tests: |
659 logprocessor.add_record(info, section, ignored_fields) | 660 logprocessor.add_record(info, section, ignored_fields) |
660 self.assertEqual(section, expected_result) | 661 self.assertEqual(section, expected_result) |
661 | 662 |
662 if __name__ == '__main__': | 663 if __name__ == '__main__': |
663 unittest.main() | 664 unittest.main() |
OLD | NEW |