Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion httpagentparser/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ class ChromeiOS(Browser):

class ChromeOS(OS):
look_for = "CrOS"
platform = ' ChromeOS'
platform = 'ChromeOS'
version_markers = [" ", " "]

def getVersion(self, agent, word):
Expand Down
7 changes: 4 additions & 3 deletions tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
{'bot': False, 'os': {'name': 'iOS'}, 'dist': {'name': 'iPhone'}, 'browser': {'version': '3.0', 'name': 'Safari'}},),
("Mozilla/5.0 (X11; CrOS i686 0.0.0) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.27 Safari/534.24,gzip(gfe)",
('ChromeOS 0.0.0', 'Chrome 11.0.696.27'),
{'bot': False, 'os': {'name': 'ChromeOS', 'version': '0.0.0'}, 'browser': {'name': 'Chrome', 'version': '11.0.696.27'}},),
{'bot': False, 'platform': {'name': 'ChromeOS', 'version': '0.0.0'}, 'os': {'name': 'ChromeOS', 'version': '0.0.0'}, 'browser': {'name': 'Chrome', 'version': '11.0.696.27'}},),
("Mozilla/4.0 (compatible; MSIE 6.0; MSIE 5.5; Windows NT 5.1) Opera 7.02 [en]",
('Windows XP', 'Opera 7.02'),
{'bot': False, 'os': {'name': 'Windows', 'version': 'XP'}, 'browser': {'name': 'Opera', 'version': '7.02'}},),
Expand Down Expand Up @@ -121,7 +121,7 @@
{'bot': False, 'os': {'name': 'Windows', 'version': '7'}, 'browser': {'version': '17.0.1241.53', 'name': 'Opera'}},),
('Mozilla/5.0+(X11;+CrOS+i686+2465.163.0)+AppleWebKit/537.1+(KHTML,+like+Gecko)+Chrome/21.0.1180.91+Safari/537.1',
('ChromeOS 2465.163.0', 'Chrome 21.0.1180.91'),
{'bot': False, 'os': {'version': '2465.163.0', 'name': 'ChromeOS'}, 'browser': {'version': '21.0.1180.91', 'name': 'Chrome'}},),
{'bot': False, 'platform': {'name': 'ChromeOS', 'version': '2465.163.0'}, 'os': {'version': '2465.163.0', 'name': 'ChromeOS'}, 'browser': {'version': '21.0.1180.91', 'name': 'Chrome'}},),
('Mozilla/5.0 (Linux; U; en-us; KFOT Build/IML74K) AppleWebKit/535.19 (KHTML, like Gecko) Silk/2.2 Safari/535.19 Silk-Accelerated=true',
('Linux', 'Safari 535.19'),
{'bot': False, 'os': {'name': 'Linux'}, 'browser': {'version': '535.19', 'name': 'Safari'}}),
Expand Down Expand Up @@ -193,7 +193,8 @@ def test_simple_detect(self):
def test_detect(self):
for agent, simple_res, res in data:
detected = detect(agent)
del detected['platform']
if 'platform' not in res:
del detected['platform']
Comment on lines -196 to +197
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the platform wasn't tested before in tests, I don't know was it intentional or not, but that's the only way I can test the typo fix - let me know if you want me to keep only typo fix, without test updates

self.assertEqual(detected, res)

def test_bot(self):
Expand Down