aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2012-03-27 11:25:50 +1300
committerAldo Cortesi <aldo@nullcube.com>2012-03-27 11:25:50 +1300
commite9ac4bef2065abe545fbc7e8712c027f573082b3 (patch)
tree80dac4ecb44ceb08baceb780b25e82347a061e58 /test
parent690f797da2b22bb48e1d574dde2f02affa6010d3 (diff)
downloadmitmproxy-e9ac4bef2065abe545fbc7e8712c027f573082b3.tar.gz
mitmproxy-e9ac4bef2065abe545fbc7e8712c027f573082b3.tar.bz2
mitmproxy-e9ac4bef2065abe545fbc7e8712c027f573082b3.zip
Add a variant of cleanBin that escapes newlines and tabs.
Use this to fix the hex display option.
Diffstat (limited to 'test')
-rw-r--r--test/test_utils.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/test_utils.py b/test/test_utils.py
index d65fa5b4..e445614a 100644
--- a/test/test_utils.py
+++ b/test/test_utils.py
@@ -224,7 +224,17 @@ class u_parse_content_type(libpry.AutoTree):
assert v == ('text', 'html', {'charset': 'UTF-8'})
+class u_cleanBin(libpry.AutoTree):
+ def test_simple(self):
+ assert utils.cleanBin("one") == "one"
+ assert utils.cleanBin("\00ne") == ".ne"
+ assert utils.cleanBin("\nne") == "\nne"
+ assert utils.cleanBin("\nne", True) == ".ne"
+
+
+
tests = [
+ u_cleanBin(),
u_parse_content_type(),
uformat_timestamp(),
uisBin(),