aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--test/mitmproxy/utils/test_typecheck.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/mitmproxy/utils/test_typecheck.py b/test/mitmproxy/utils/test_typecheck.py
index fe33070e..8e4198da 100644
--- a/test/mitmproxy/utils/test_typecheck.py
+++ b/test/mitmproxy/utils/test_typecheck.py
@@ -111,3 +111,11 @@ def test_check_command_type():
m.__str__ = lambda self: "typing.Union"
m.__union_params__ = (int,)
assert not typecheck.check_command_type([22], m)
+
+
+def test_typesec_to_str():
+ assert(typecheck.typespec_to_str(str)) == "str"
+ assert(typecheck.typespec_to_str(typing.Sequence[str])) == "Sequence"
+ assert(typecheck.typespec_to_str(typing.Optional[str])) == "Union"
+ with pytest.raises(NotImplementedError):
+ typecheck.typespec_to_str(dict)