diff options
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/pickletester.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/pickletester.py b/Lib/test/pickletester.py index 04bb842..0bdcc10 100644 --- a/Lib/test/pickletester.py +++ b/Lib/test/pickletester.py @@ -1100,6 +1100,15 @@ class AbstractPickleModuleTests(unittest.TestCase): exec teststr in {'__builtins__': builtins}, d d['f']() + def test_bad_input(self): + # Test issue4298 + s = '\x58\0\0\0\x54' + self.assertRaises(EOFError, self.module.loads, s) + # Test issue7455 + s = '0' + # XXX Why doesn't pickle raise UnpicklingError? + self.assertRaises((IndexError, cPickle.UnpicklingError), + self.module.loads, s) class AbstractPersistentPicklerTests(unittest.TestCase): |