2023-10-17 20:51:23 +00:00
|
|
|
from mwmbl.indexer.blacklist import is_domain_blacklisted
|
|
|
|
|
|
|
|
|
|
|
|
def test_blacklist_excludes_bad_pattern():
|
|
|
|
bad_domains = [
|
|
|
|
"brofqpxj.uelinc.com",
|
2023-10-17 21:05:53 +00:00
|
|
|
"gzsmjc.fba01.com",
|
|
|
|
"59648.etnomurcia.com",
|
2023-10-18 16:02:45 +00:00
|
|
|
"something.hzqwyou.cn",
|
2023-10-17 20:51:23 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
for domain in bad_domains:
|
|
|
|
assert is_domain_blacklisted(domain, set())
|
|
|
|
|
|
|
|
|
|
|
|
def test_blacklist_allows_top_domains():
|
|
|
|
assert not is_domain_blacklisted("teamblog.supportbee.com", set())
|
|
|
|
|
|
|
|
|
|
|
|
def test_blacklist_allows_other_domains():
|
|
|
|
assert not is_domain_blacklisted("something.com", set())
|