28
28
google_bot_ua_string = 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)'
29
29
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'
30
30
android_firefox_aurora_ua_string = 'Mozilla/5.0 (Android; Mobile; rv:27.0) Gecko/27.0 Firefox/27.0'
31
+ thunderbird_ua_string = 'Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 Lightning/4.0.2'
32
+ outlook_usa_string = 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/6.0; Microsoft Outlook 15.0.4420)'
31
33
32
34
iphone_ua = parse (iphone_ua_string )
33
35
ipad_ua = parse (ipad_ua_string )
50
52
google_bot_ua = parse (google_bot_ua_string )
51
53
nokia_n97_ua = parse (nokia_n97_ua_string )
52
54
android_firefox_aurora_ua = parse (android_firefox_aurora_ua_string )
55
+ thunderbird_ua = parse (thunderbird_ua_string )
56
+ outlook_ua = parse (outlook_usa_string )
53
57
54
58
55
59
class UserAgentsTest (unittest .TestCase ):
@@ -183,6 +187,26 @@ def test_is_bot(self):
183
187
self .assertFalse (nokia_n97_ua .is_bot )
184
188
self .assertFalse (android_firefox_aurora_ua .is_bot )
185
189
190
+ def test_is_email_client (self ):
191
+ self .assertTrue (thunderbird_ua .is_email_client )
192
+ self .assertTrue (outlook_ua .is_email_client )
193
+ self .assertFalse (playbook_ua .is_email_client )
194
+ self .assertFalse (kindle_fire_ua .is_email_client )
195
+ self .assertFalse (nexus_7_ua .is_email_client )
196
+ self .assertFalse (windows_phone_ua .is_email_client )
197
+ self .assertFalse (blackberry_bold_touch_ua .is_email_client )
198
+ self .assertFalse (blackberry_torch_ua .is_email_client )
199
+ self .assertFalse (blackberry_bold_ua .is_email_client )
200
+ self .assertFalse (j2me_opera_ua .is_email_client )
201
+ self .assertFalse (mac_safari_ua .is_email_client )
202
+ self .assertFalse (windows_ie_ua .is_email_client )
203
+ self .assertFalse (ubuntu_firefox_ua .is_email_client )
204
+ self .assertFalse (ie_touch_ua .is_email_client )
205
+ self .assertFalse (ie_ua .is_email_client )
206
+ self .assertFalse (nokia_n97_ua .is_email_client )
207
+ self .assertFalse (android_firefox_aurora_ua .is_email_client )
208
+
209
+
186
210
def test_strings (self ):
187
211
self .assertEqual (str (iphone_ua ), "iPhone / iOS 5.1 / Mobile Safari 5.1" )
188
212
self .assertEqual (str (ipad_ua ), "iPad / iOS 3.2 / Mobile Safari 4.0.4" )
0 commit comments