From e9ac4bef2065abe545fbc7e8712c027f573082b3 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Tue, 27 Mar 2012 11:25:50 +1300 Subject: Add a variant of cleanBin that escapes newlines and tabs. Use this to fix the hex display option. --- test/test_utils.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test') 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(), -- cgit v1.2.3