Commits

Jason R. Coombs committed 54b89ba

Added test to capture silent ignore of invalid input in ntob.

Comments (0)

Files changed (1)

cherrypy/test/test_compat.py

+import unittest
+
+import nose
+
+from cherrypy import _cpcompat as compat
+
+class StringTester(unittest.TestCase):
+    def test_ntob_non_native(self):
+        """
+        ntob should raise an Exception on unicode.
+        (Python 2 only)
+
+        See #1132 for discussion.
+        """
+        if compat.py3k:
+            raise nose.SkipTest("Only useful on Python 2")
+        self.assertRaises(Exception, compat.ntob, u'fight')