diff --git a/app/tests/unit/utils/test_utils.py b/app/tests/unit/utils/test_utils.py index 1214898c..98030fe9 100644 --- a/app/tests/unit/utils/test_utils.py +++ b/app/tests/unit/utils/test_utils.py @@ -17,5 +17,17 @@ import user_agents +def test_web_is_not_bot(): + assert not user_agents.parse("Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:126.0) Gecko/20100101 Firefox/126.0").is_bot + assert not user_agents.parse("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) " + "Chrome/125.0.0.0 Safari/537.36").is_bot + + def test_minetest_is_not_bot(): assert not user_agents.parse("Minetest/5.5.1 (Linux/4.14.193+-ab49821 aarch64)").is_bot + + +def test_crawlers_are_bots(): + assert user_agents.parse("Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5X Build/MMB29P) AppleWebKit/537.36 (KHTML, " + "like Gecko) Chrome/W.X.Y.Z Mobile Safari/537.36 (compatible; Googlebot/2.1; " + "+http://www.google.com/bot.html)").is_bot diff --git a/requirements.lock.txt b/requirements.lock.txt index a287558f..8204c287 100644 --- a/requirements.lock.txt +++ b/requirements.lock.txt @@ -56,7 +56,7 @@ pytz==2024.1 PyYAML==6.0.1 redis==5.0.4 requests==2.32.2 -sentry-sdk==2.3.1 +sentry-sdk[flask]==2.3.1 six==1.16.0 smmap==5.0.1 soupsieve==2.5