From c21ee90debe13154f4d34aed1f088796a2d0c02c Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Fri, 6 Jan 2017 00:58:21 +0100 Subject: add strutils.replace_surrogates --- test/mitmproxy/utils/test_strutils.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test') diff --git a/test/mitmproxy/utils/test_strutils.py b/test/mitmproxy/utils/test_strutils.py index 1372d31f..1fb4949f 100644 --- a/test/mitmproxy/utils/test_strutils.py +++ b/test/mitmproxy/utils/test_strutils.py @@ -19,6 +19,11 @@ def test_always_str(): assert strutils.always_str(None) is None +def test_replace_surrogates(): + assert strutils.replace_surrogates("foo") == "foo" + assert strutils.replace_surrogates("bar \udc80 baz") == "bar � baz" + + def test_escape_control_characters(): assert strutils.escape_control_characters(u"one") == u"one" assert strutils.escape_control_characters(u"\00ne") == u".ne" -- cgit v1.2.3