from rkn_checker.http import looks_like_stub class TestLooksLikeStub: def test_empty_body_is_not_stub(self): assert looks_like_stub("") is False def test_normal_page_is_not_stub(self): body = "welcome to our online store" assert looks_like_stub(body) is False def test_detects_access_restricted_phrase(self): body = "доступ ограничен по решению суда" assert looks_like_stub(body) is True def test_detects_blocked_phrase(self): body = "сайт заблокирован" assert looks_like_stub(body) is True def test_detects_english_blocked_by(self): body = "this resource is blocked by your provider" assert looks_like_stub(body) is True def test_detects_rkn_link(self): body = "for more information visit rkn.gov.ru" assert looks_like_stub(body) is True def test_detects_unified_registry_phrase(self): body = "сайт включён в единый реестр запрещённых ресурсов" assert looks_like_stub(body) is True def test_caller_must_lowercase_body(self): # The matcher does a plain substring scan — uppercase shouldn't match. body = "ДОСТУП ОГРАНИЧЕН" assert looks_like_stub(body) is False