24
24
ubuntu_firefox_ua_string = 'Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:15.0) Gecko/20100101 Firefox/15.0.1'
25
25
google_bot_ua_string = 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)'
26
26
nokia_n97_ua_string = 'Mozilla/5.0 (SymbianOS/9.4; Series60/5.0 NokiaN97-1/12.0.024; Profile/MIDP-2.1 Configuration/CLDC-1.1; en-us) AppleWebKit/525 (KHTML, like Gecko) BrowserNG/7.1.12344'
27
+ android_firefox_aurora_ua_string = 'Mozilla/5.0 (Android; Mobile; rv:27.0) Gecko/27.0 Firefox/27.0'
27
28
28
29
iphone_ua = parse (iphone_ua_string )
29
30
ipad_ua = parse (ipad_ua_string )
45
46
ubuntu_firefox_ua = parse (ubuntu_firefox_ua_string )
46
47
google_bot_ua = parse (google_bot_ua_string )
47
48
nokia_n97_ua = parse (nokia_n97_ua_string )
49
+ android_firefox_aurora_ua = parse (android_firefox_aurora_ua_string )
48
50
49
51
50
52
class UserAgentsTest (unittest .TestCase ):
@@ -90,6 +92,7 @@ def test_is_tablet_property(self):
90
92
self .assertTrue (playbook_ua .is_tablet )
91
93
self .assertTrue (kindle_fire_ua .is_tablet )
92
94
self .assertTrue (nexus_7_ua .is_tablet )
95
+ self .assertFalse (android_firefox_aurora_ua .is_tablet )
93
96
94
97
def test_is_mobile_property (self ):
95
98
self .assertTrue (iphone_ua .is_mobile )
@@ -110,6 +113,7 @@ def test_is_mobile_property(self):
110
113
self .assertFalse (windows_ie_ua .is_mobile )
111
114
self .assertFalse (ubuntu_firefox_ua .is_mobile )
112
115
self .assertFalse (google_bot_ua .is_mobile )
116
+ self .assertTrue (android_firefox_aurora_ua .is_mobile )
113
117
114
118
def test_is_touch_property (self ):
115
119
self .assertTrue (iphone_ua .is_touch_capable )
@@ -130,6 +134,7 @@ def test_is_touch_property(self):
130
134
self .assertFalse (ubuntu_firefox_ua .is_touch_capable )
131
135
self .assertFalse (google_bot_ua .is_touch_capable )
132
136
self .assertFalse (nokia_n97_ua .is_touch_capable )
137
+ self .assertTrue (android_firefox_aurora_ua .is_touch_capable )
133
138
134
139
def test_is_pc (self ):
135
140
self .assertFalse (iphone_ua .is_pc )
@@ -150,6 +155,7 @@ def test_is_pc(self):
150
155
self .assertTrue (ubuntu_firefox_ua .is_pc )
151
156
self .assertTrue (ie_touch_ua .is_pc )
152
157
self .assertTrue (ie_ua .is_pc )
158
+ self .assertFalse (android_firefox_aurora_ua .is_pc )
153
159
154
160
def test_is_bot (self ):
155
161
self .assertTrue (google_bot_ua .is_bot )
@@ -170,3 +176,4 @@ def test_is_bot(self):
170
176
self .assertFalse (ie_touch_ua .is_bot )
171
177
self .assertFalse (ie_ua .is_bot )
172
178
self .assertFalse (nokia_n97_ua .is_bot )
179
+ self .assertFalse (android_firefox_aurora_ua .is_bot )
0 commit comments