mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
Issue #13849: Merge from 3.5
This commit is contained in:
commit
804a39f04f
1 changed files with 9 additions and 0 deletions
|
@ -272,6 +272,15 @@ class TestGenericTest(GenericTest, unittest.TestCase):
|
|||
# and is only meant to be inherited by others.
|
||||
pathmodule = genericpath
|
||||
|
||||
def test_null_bytes(self):
|
||||
for attr in GenericTest.common_attributes:
|
||||
# os.path.commonprefix doesn't raise ValueError
|
||||
if attr == 'commonprefix':
|
||||
continue
|
||||
with self.subTest(attr=attr):
|
||||
with self.assertRaises(ValueError) as cm:
|
||||
getattr(self.pathmodule, attr)('/tmp\x00abcds')
|
||||
self.assertEqual(str(cm.exception), 'embedded null byte')
|
||||
|
||||
# Following TestCase is not supposed to be run from test_genericpath.
|
||||
# It is inherited by other test modules (macpath, ntpath, posixpath).
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue