From 8d4ff422e089cd5336c771b4b3930c944a716314 Mon Sep 17 00:00:00 2001 From: Kseniya Shychko Date: Sun, 14 Jan 2024 17:46:22 +0100 Subject: [PATCH] fix: update user agent parsing test --- alb-s3-sqs-es/tests/test_message.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/alb-s3-sqs-es/tests/test_message.py b/alb-s3-sqs-es/tests/test_message.py index fc8e890..9e12e3f 100644 --- a/alb-s3-sqs-es/tests/test_message.py +++ b/alb-s3-sqs-es/tests/test_message.py @@ -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