diff options
Diffstat (limited to 'Lib/test/test_bytes.py')
-rw-r--r-- | Lib/test/test_bytes.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_bytes.py b/Lib/test/test_bytes.py index 5c6238b..234b56c 100644 --- a/Lib/test/test_bytes.py +++ b/Lib/test/test_bytes.py @@ -305,6 +305,11 @@ class BaseBytesTest(unittest.TestCase): self.assertTrue(b.startswith(b"h")) self.assertFalse(b.startswith(b"hellow")) self.assertFalse(b.startswith(b"ha")) + with self.assertRaises(TypeError) as cm: + b.startswith([b'h']) + exc = str(cm.exception) + self.assertIn('bytes', exc) + self.assertIn('tuple', exc) def test_endswith(self): b = self.type2test(b'hello') @@ -314,6 +319,11 @@ class BaseBytesTest(unittest.TestCase): self.assertTrue(b.endswith(b"o")) self.assertFalse(b.endswith(b"whello")) self.assertFalse(b.endswith(b"no")) + with self.assertRaises(TypeError) as cm: + b.endswith([b'o']) + exc = str(cm.exception) + self.assertIn('bytes', exc) + self.assertIn('tuple', exc) def test_find(self): b = self.type2test(b'mississippi') |