Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
3532fd85
Commit
3532fd85
authored
Jul 23, 2016
by
Berker Peksag
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #13849: Add tests for null byte checking in test_genericpath
parent
0afd771e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
Lib/test/test_genericpath.py
Lib/test/test_genericpath.py
+9
-0
No files found.
Lib/test/test_genericpath.py
View file @
3532fd85
...
@@ -274,6 +274,15 @@ class TestGenericTest(GenericTest, unittest.TestCase):
...
@@ -274,6 +274,15 @@ class TestGenericTest(GenericTest, unittest.TestCase):
# and is only meant to be inherited by others.
# and is only meant to be inherited by others.
pathmodule
=
genericpath
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
\
x00
abcds'
)
self
.
assertEqual
(
str
(
cm
.
exception
),
'embedded null byte'
)
# Following TestCase is not supposed to be run from test_genericpath.
# Following TestCase is not supposed to be run from test_genericpath.
# It is inherited by other test modules (macpath, ntpath, posixpath).
# It is inherited by other test modules (macpath, ntpath, posixpath).
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment