mitmproxy/test/netlib/test_check.py
Aldo Cortesi 9870844b38 netlib.utils -> netlib.check
Now only contains is_valid_[host,port]

Intermediate step - this will be in mitproxy.net soon.
2016-10-20 10:46:47 +13:00

11 lines
245 B
Python

# coding=utf-8
from netlib import check
def test_is_valid_host():
assert not check.is_valid_host(b"")
assert check.is_valid_host(b"one.two")
assert not check.is_valid_host(b"one" * 255)
assert check.is_valid_host(b"one.two.")