summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_codeccallbacks.py
diff options
context:
space:
mode:
authorWalter Dörwald <walter@livinglogic.de>2005-11-17 08:52:34 (GMT)
committerWalter Dörwald <walter@livinglogic.de>2005-11-17 08:52:34 (GMT)
commite22d339dc53946f384aec1ba3cb70cc53ef621cd (patch)
treeacddf302101212b73f237927ec7df7a11fef002b /Lib/test/test_codeccallbacks.py
parent944d3eb1546e38d4944db5f2f41f5560d55a5053 (diff)
downloadcpython-e22d339dc53946f384aec1ba3cb70cc53ef621cd.zip
cpython-e22d339dc53946f384aec1ba3cb70cc53ef621cd.tar.gz
cpython-e22d339dc53946f384aec1ba3cb70cc53ef621cd.tar.bz2
Add tests for various error cases and for readbuffer_encode() and
charbuffer_encode(). This increases code coverage in Modules/_codecsmodule.c from 83% to 95%.
Diffstat (limited to 'Lib/test/test_codeccallbacks.py')
-rw-r--r--Lib/test/test_codeccallbacks.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_codeccallbacks.py b/Lib/test/test_codeccallbacks.py
index f8e59cd..7d32e59 100644
--- a/Lib/test/test_codeccallbacks.py
+++ b/Lib/test/test_codeccallbacks.py
@@ -577,6 +577,11 @@ class CodecCallbackTest(unittest.TestCase):
self.assertRaises(TypeError, codecs.register_error, 42)
self.assertRaises(TypeError, codecs.register_error, "test.dummy", 42)
+ def test_badlookupcall(self):
+ # enhance coverage of:
+ # Modules/_codecsmodule.c::lookup_error()
+ self.assertRaises(TypeError, codecs.lookup_error)
+
def test_unknownhandler(self):
# enhance coverage of:
# Modules/_codecsmodule.c::lookup_error()