summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBerker Peksag <berker.peksag@gmail.com>2016-07-23 04:32:14 (GMT)
committerBerker Peksag <berker.peksag@gmail.com>2016-07-23 04:32:14 (GMT)
commit804a39f04fa7b55d5cd23f720252bbb603444d62 (patch)
treeccd817a8ffdf6165ee7ebf5997e74d62e5edf198
parentb3bb436b867fba9d755d67452e27315b5017bdfc (diff)
parent9adc1a38bda536e6f02fb5b3b1bbd231160a50de (diff)
downloadcpython-804a39f04fa7b55d5cd23f720252bbb603444d62.zip
cpython-804a39f04fa7b55d5cd23f720252bbb603444d62.tar.gz
cpython-804a39f04fa7b55d5cd23f720252bbb603444d62.tar.bz2
Issue #13849: Merge from 3.5
-rw-r--r--Lib/test/test_genericpath.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_genericpath.py b/Lib/test/test_genericpath.py
index 9c28a68..b52d460 100644
--- a/Lib/test/test_genericpath.py
+++ b/Lib/test/test_genericpath.py
@@ -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).