mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
#6780: merge with 3.1.
This commit is contained in:
commit
f2b3f780a1
6 changed files with 53 additions and 9 deletions
|
@ -303,6 +303,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')
|
||||
|
@ -312,6 +317,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')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue