aboutsummaryrefslogtreecommitdiffstats
path: root/test/netlib/test_check.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2016-10-20 10:46:47 +1300
committerAldo Cortesi <aldo@nullcube.com>2016-10-20 10:46:47 +1300
commit9870844b38c84e7446b15909758497cecb26301e (patch)
treeabb86d6ff64934ec274e5cf2cd5634e92480623a /test/netlib/test_check.py
parente0f3cce14cb26d10bc259d431f688fb0d10ab3f5 (diff)
downloadmitmproxy-9870844b38c84e7446b15909758497cecb26301e.tar.gz
mitmproxy-9870844b38c84e7446b15909758497cecb26301e.tar.bz2
mitmproxy-9870844b38c84e7446b15909758497cecb26301e.zip
netlib.utils -> netlib.check
Now only contains is_valid_[host,port] Intermediate step - this will be in mitproxy.net soon.
Diffstat (limited to 'test/netlib/test_check.py')
-rw-r--r--test/netlib/test_check.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/netlib/test_check.py b/test/netlib/test_check.py
new file mode 100644
index 00000000..6a1388f4
--- /dev/null
+++ b/test/netlib/test_check.py
@@ -0,0 +1,10 @@
+# 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.")