示例#1
0
def test_match_domain(a: Any, b: Any, result: Any) -> None:
    if "*" in a:
        rule = MaskDomain(a)
    else:
        rule = Domain(a)
    assert rule.match_domain(b) is result
示例#2
0
def test_domain_valid() -> None:
    assert Domain("example.com:81").canonical == "example.com:81"
    assert MaskDomain("*.example.com").canonical == r".*\.example\.com"
    assert Domain("пуни.код").canonical == "xn--h1ajfq.xn--d1alm"
示例#3
0
def test_domain_valid():
    assert Domain('example.com:81').canonical == 'example.com:81'
    assert MaskDomain('*.example.com').canonical == r'.*\.example\.com'
    assert Domain('пуни.код').canonical == 'xn--h1ajfq.xn--d1alm'
示例#4
0
def test_match_domain(a, b, result):
    if '*' in a:
        rule = MaskDomain(a)
    else:
        rule = Domain(a)
    assert rule.match_domain(b) is result
示例#5
0
def test_match_domain(a, b, result):
    if '*' in a:
        rule = MaskDomain(a)
    else:
        rule = Domain(a)
    assert rule.match_domain(b) is result