diff options
author | Marc Abramowitz <marc@marc-abramowitz.com> | 2016-03-07 14:05:52 -0800 |
---|---|---|
committer | Marc Abramowitz <marc@marc-abramowitz.com> | 2016-03-07 14:05:52 -0800 |
commit | 42b22881290e00e06b840dee1e42f0f5ef044d47 (patch) | |
tree | b4fef928625acd3e8ee45ccaa8c7a6c9810b3601 /tests/test_util/test_quoting.py | |
download | paste-git-tox_add_py35.tar.gz |
tox.ini: Add py35 to envlisttox_add_py35
Diffstat (limited to 'tests/test_util/test_quoting.py')
-rw-r--r-- | tests/test_util/test_quoting.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/test_util/test_quoting.py b/tests/test_util/test_quoting.py new file mode 100644 index 0000000..5f5e0a8 --- /dev/null +++ b/tests/test_util/test_quoting.py @@ -0,0 +1,28 @@ +from paste.util import quoting +import six +import unittest + +class TestQuoting(unittest.TestCase): + def test_html_unquote(self): + self.assertEqual(quoting.html_unquote(b'<hey you>'), + u'<hey\xa0you>') + self.assertEqual(quoting.html_unquote(b''), + u'') + self.assertEqual(quoting.html_unquote(b'&blahblah;'), + u'&blahblah;') + self.assertEqual(quoting.html_unquote(b'\xe1\x80\xa9'), + u'\u1029') + + def test_html_quote(self): + self.assertEqual(quoting.html_quote(1), + '1') + self.assertEqual(quoting.html_quote(None), + '') + self.assertEqual(quoting.html_quote('<hey!>'), + '<hey!>') + if six.PY3: + self.assertEqual(quoting.html_quote(u'<\u1029>'), + u'<\u1029>') + else: + self.assertEqual(quoting.html_quote(u'<\u1029>'), + '<\xe1\x80\xa9>') |