2828nokia_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'
2929android_firefox_aurora_ua_string = 'Mozilla/5.0 (Android; Mobile; rv:27.0) Gecko/27.0 Firefox/27.0'
3030samsung_galaxy_s_ua_string = 'Mozilla/5.0 (Linux; Android 4.4.2; en-us; SAMSUNG SCH-I545 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Version/1.5 Chrome/28.0.1500.94 Mobile Safari/537.36'
31+ playstation_vita_ua_string = 'Mozilla/5.0 (PlayStation Vita 3.12) AppleWebKit/536.26 (KHTML, like Gecko) Silk/3.2'
32+ playstation_ua_string = 'Mozilla/5.0 (PLAYSTATION 3 4.60) AppleWebKit/531.22.8 (KHTML, like Gecko)'
33+ samsung_gt_ua_string = 'Mozilla/5.0 (SAMSUNG; SAMSUNG-GT-S8530/S8530DDLC2; U; Bada/2.0; en-us) AppleWebKit/534.20 (KHTML, like Gecko) Dolfin/3.0 Mobile WVGA SMM-MMS/1.2.0 OPN-B'
34+
3135
3236iphone_ua = parse (iphone_ua_string )
3337ipad_ua = parse (ipad_ua_string )
5155nokia_n97_ua = parse (nokia_n97_ua_string )
5256android_firefox_aurora_ua = parse (android_firefox_aurora_ua_string )
5357samsung_galaxy_s_ua = parse (samsung_galaxy_s_ua_string )
58+ playstation_vita_ua = parse (playstation_vita_ua_string )
59+ playstation_ua = parse (playstation_ua_string )
60+ samsung_gt_ua = parse (samsung_gt_ua_string )
5461
5562
5663class UserAgentsTest (unittest .TestCase ):
@@ -98,6 +105,10 @@ def test_is_tablet_property(self):
98105 self .assertTrue (nexus_7_ua .is_tablet )
99106 self .assertFalse (android_firefox_aurora_ua .is_tablet )
100107 self .assertFalse (samsung_galaxy_s_ua .is_tablet )
108+ self .assertFalse (playstation_vita_ua .is_tablet )
109+ self .assertFalse (playstation_ua .is_tablet )
110+ self .assertFalse (samsung_gt_ua .is_tablet )
111+
101112
102113 def test_is_mobile_property (self ):
103114 self .assertTrue (iphone_ua .is_mobile )
@@ -120,6 +131,10 @@ def test_is_mobile_property(self):
120131 self .assertFalse (google_bot_ua .is_mobile )
121132 self .assertTrue (android_firefox_aurora_ua .is_mobile )
122133 self .assertTrue (samsung_galaxy_s_ua .is_mobile )
134+ self .assertTrue (playstation_vita_ua .is_mobile )
135+ self .assertFalse (playstation_ua .is_mobile )
136+ self .assertTrue (samsung_gt_ua .is_mobile )
137+
123138
124139 def test_is_touch_property (self ):
125140 self .assertTrue (iphone_ua .is_touch_capable )
@@ -142,6 +157,10 @@ def test_is_touch_property(self):
142157 self .assertFalse (nokia_n97_ua .is_touch_capable )
143158 self .assertTrue (android_firefox_aurora_ua .is_touch_capable )
144159 self .assertTrue (samsung_galaxy_s_ua .is_touch_capable )
160+ self .assertFalse (playstation_vita_ua .is_touch_capable )
161+ self .assertFalse (playstation_ua .is_touch_capable )
162+ self .assertFalse (samsung_gt_ua .is_touch_capable )
163+
145164
146165 def test_is_pc (self ):
147166 self .assertFalse (iphone_ua .is_pc )
@@ -152,7 +171,7 @@ def test_is_pc(self):
152171 self .assertFalse (nexus_7_ua .is_pc )
153172 self .assertFalse (windows_phone_ua .is_pc )
154173 self .assertFalse (blackberry_bold_touch_ua .is_pc )
155- self .assertFalse (blackberry_torch_ua .is_pc )
174+ self .assertFalse (blackberry_torch_ua .is_pc )
156175 self .assertFalse (blackberry_bold_ua .is_pc )
157176 self .assertFalse (j2me_opera_ua .is_pc )
158177 self .assertFalse (google_bot_ua .is_pc )
@@ -164,6 +183,10 @@ def test_is_pc(self):
164183 self .assertTrue (ie_ua .is_pc )
165184 self .assertFalse (android_firefox_aurora_ua .is_pc )
166185 self .assertFalse (samsung_galaxy_s_ua .is_pc )
186+ self .assertFalse (playstation_vita_ua .is_pc )
187+ self .assertFalse (playstation_ua .is_pc )
188+ self .assertFalse (samsung_gt_ua .is_pc )
189+
167190
168191 def test_is_bot (self ):
169192 self .assertTrue (google_bot_ua .is_bot )
@@ -175,9 +198,9 @@ def test_is_bot(self):
175198 self .assertFalse (nexus_7_ua .is_bot )
176199 self .assertFalse (windows_phone_ua .is_bot )
177200 self .assertFalse (blackberry_bold_touch_ua .is_bot )
178- self .assertFalse (blackberry_torch_ua .is_bot )
201+ self .assertFalse (blackberry_torch_ua .is_bot )
179202 self .assertFalse (blackberry_bold_ua .is_bot )
180- self .assertFalse (j2me_opera_ua .is_bot )
203+ self .assertFalse (j2me_opera_ua .is_bot )
181204 self .assertFalse (mac_safari_ua .is_bot )
182205 self .assertFalse (windows_ie_ua .is_bot )
183206 self .assertFalse (ubuntu_firefox_ua .is_bot )
@@ -186,6 +209,10 @@ def test_is_bot(self):
186209 self .assertFalse (nokia_n97_ua .is_bot )
187210 self .assertFalse (android_firefox_aurora_ua .is_bot )
188211 self .assertFalse (samsung_galaxy_s_ua .is_bot )
212+ self .assertFalse (playstation_vita_ua .is_bot )
213+ self .assertFalse (playstation_ua .is_bot )
214+ self .assertFalse (samsung_gt_ua .is_bot )
215+
189216
190217 def test_strings (self ):
191218 self .assertEqual (str (iphone_ua ), "iPhone / iOS 5.1 / Mobile Safari 5.1" )
0 commit comments