Skip to content

Commit

Permalink
fix: update user agent parsing test
Browse files Browse the repository at this point in the history
  • Loading branch information
kshychko committed Jan 14, 2024
1 parent d02bfe7 commit 8d4ff42
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions alb-s3-sqs-es/tests/test_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,15 @@ def test_app_loadbalancer_log_https_useragent(loadbalancer_https_entry):
msg = loadbalancer_https_entry.payload()

assert msg['type'] == 'https'
assert msg['user_agent'].startswith('Mozilla/5.0 (Macintosh;')
assert msg['user_agent_details']['browser'] == 'Firefox 88.0'
assert msg['user_agent_details']['os'] == 'Mac OS X 10.15'
assert msg['user_agent_details']['device'] == 'PC'
assert msg['user_agent_details']['user_agent'].startswith('Mozilla/5.0 (Macintosh;')
assert msg['user_agent_details']['browser'] == 'Firefox'
assert msg['user_agent_details']['browser_version'] == '88.0'
assert msg['user_agent_details']['os'] == 'Mac OS X'
assert msg['user_agent_details']['os_version'] == '10.15'
assert msg['user_agent_details']['device_family'] == 'Generic Feature Phone'
assert msg['user_agent_details']['device_brand'] == 'Generic'
assert msg['user_agent_details']['device_model'] == 'Feature Phone'
assert msg['user_agent_details']['is_pc'] is True
assert msg['user_agent_details']['is_bot'] is False
assert msg['user_agent_details']['is_tablet'] is False
assert msg['user_agent_details']['is_mobile'] is True

0 comments on commit 8d4ff42

Please sign in to comment.