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
97d7906e
Commit
97d7906e
authored
Sep 10, 2019
by
Steve Dower
Committed by
Zachary Ware
Sep 10, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-38087: Fix case sensitivity in test_pathlib and test_ntpath (GH-15850)
parent
cd822115
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
125 additions
and
107 deletions
+125
-107
Lib/test/test_ntpath.py
Lib/test/test_ntpath.py
+105
-91
Lib/test/test_pathlib.py
Lib/test/test_pathlib.py
+19
-16
Misc/NEWS.d/next/Windows/2019-09-10-14-21-40.bpo-38087.--eIib.rst
...S.d/next/Windows/2019-09-10-14-21-40.bpo-38087.--eIib.rst
+1
-0
No files found.
Lib/test/test_ntpath.py
View file @
97d7906e
This diff is collapsed.
Click to expand it.
Lib/test/test_pathlib.py
View file @
97d7906e
...
...
@@ -1361,10 +1361,13 @@ class _BasePathTest(object):
func
(
*
args
,
**
kwargs
)
self
.
assertEqual
(
cm
.
exception
.
errno
,
errno
.
ENOENT
)
def
assertEqualNormCase
(
self
,
path_a
,
path_b
):
self
.
assertEqual
(
os
.
path
.
normcase
(
path_a
),
os
.
path
.
normcase
(
path_b
))
def
_test_cwd
(
self
,
p
):
q
=
self
.
cls
(
os
.
getcwd
())
self
.
assertEqual
(
p
,
q
)
self
.
assertEqual
(
str
(
p
),
str
(
q
))
self
.
assertEqual
NormCase
(
str
(
p
),
str
(
q
))
self
.
assertIs
(
type
(
p
),
type
(
q
))
self
.
assertTrue
(
p
.
is_absolute
())
...
...
@@ -1375,7 +1378,7 @@ class _BasePathTest(object):
def
_test_home
(
self
,
p
):
q
=
self
.
cls
(
os
.
path
.
expanduser
(
'~'
))
self
.
assertEqual
(
p
,
q
)
self
.
assertEqual
(
str
(
p
),
str
(
q
))
self
.
assertEqual
NormCase
(
str
(
p
),
str
(
q
))
self
.
assertIs
(
type
(
p
),
type
(
q
))
self
.
assertTrue
(
p
.
is_absolute
())
...
...
@@ -1583,14 +1586,14 @@ class _BasePathTest(object):
p
.
resolve
(
strict
=
True
)
self
.
assertEqual
(
cm
.
exception
.
errno
,
errno
.
ENOENT
)
# Non-strict
self
.
assertEqual
(
str
(
p
.
resolve
(
strict
=
False
)),
os
.
path
.
join
(
BASE
,
'foo'
))
self
.
assertEqual
NormCase
(
str
(
p
.
resolve
(
strict
=
False
)),
os
.
path
.
join
(
BASE
,
'foo'
))
p
=
P
(
BASE
,
'foo'
,
'in'
,
'spam'
)
self
.
assertEqual
(
str
(
p
.
resolve
(
strict
=
False
)),
os
.
path
.
join
(
BASE
,
'foo'
,
'in'
,
'spam'
))
self
.
assertEqual
NormCase
(
str
(
p
.
resolve
(
strict
=
False
)),
os
.
path
.
join
(
BASE
,
'foo'
,
'in'
,
'spam'
))
p
=
P
(
BASE
,
'..'
,
'foo'
,
'in'
,
'spam'
)
self
.
assertEqual
(
str
(
p
.
resolve
(
strict
=
False
)),
os
.
path
.
abspath
(
os
.
path
.
join
(
'foo'
,
'in'
,
'spam'
)))
self
.
assertEqual
NormCase
(
str
(
p
.
resolve
(
strict
=
False
)),
os
.
path
.
abspath
(
os
.
path
.
join
(
'foo'
,
'in'
,
'spam'
)))
# These are all relative symlinks.
p
=
P
(
BASE
,
'dirB'
,
'fileB'
)
self
.
_check_resolve_relative
(
p
,
p
)
...
...
@@ -2137,16 +2140,16 @@ class _BasePathTest(object):
# Resolve absolute paths.
p
=
(
P
/
'link0'
).
resolve
()
self
.
assertEqual
(
p
,
P
)
self
.
assertEqual
(
str
(
p
),
BASE
)
self
.
assertEqual
NormCase
(
str
(
p
),
BASE
)
p
=
(
P
/
'link1'
).
resolve
()
self
.
assertEqual
(
p
,
P
)
self
.
assertEqual
(
str
(
p
),
BASE
)
self
.
assertEqual
NormCase
(
str
(
p
),
BASE
)
p
=
(
P
/
'link2'
).
resolve
()
self
.
assertEqual
(
p
,
P
)
self
.
assertEqual
(
str
(
p
),
BASE
)
self
.
assertEqual
NormCase
(
str
(
p
),
BASE
)
p
=
(
P
/
'link3'
).
resolve
()
self
.
assertEqual
(
p
,
P
)
self
.
assertEqual
(
str
(
p
),
BASE
)
self
.
assertEqual
NormCase
(
str
(
p
),
BASE
)
# Resolve relative paths.
old_path
=
os
.
getcwd
()
...
...
@@ -2154,16 +2157,16 @@ class _BasePathTest(object):
try
:
p
=
self
.
cls
(
'link0'
).
resolve
()
self
.
assertEqual
(
p
,
P
)
self
.
assertEqual
(
str
(
p
),
BASE
)
self
.
assertEqual
NormCase
(
str
(
p
),
BASE
)
p
=
self
.
cls
(
'link1'
).
resolve
()
self
.
assertEqual
(
p
,
P
)
self
.
assertEqual
(
str
(
p
),
BASE
)
self
.
assertEqual
NormCase
(
str
(
p
),
BASE
)
p
=
self
.
cls
(
'link2'
).
resolve
()
self
.
assertEqual
(
p
,
P
)
self
.
assertEqual
(
str
(
p
),
BASE
)
self
.
assertEqual
NormCase
(
str
(
p
),
BASE
)
p
=
self
.
cls
(
'link3'
).
resolve
()
self
.
assertEqual
(
p
,
P
)
self
.
assertEqual
(
str
(
p
),
BASE
)
self
.
assertEqual
NormCase
(
str
(
p
),
BASE
)
finally
:
os
.
chdir
(
old_path
)
...
...
Misc/NEWS.d/next/Windows/2019-09-10-14-21-40.bpo-38087.--eIib.rst
0 → 100644
View file @
97d7906e
Fix case sensitivity in test_pathlib and test_ntpath.
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