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
ed82ca10
Commit
ed82ca10
authored
Nov 02, 2010
by
Brett Cannon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ditch some dead code in test_unicode_file.
Closes issue #10294. Thanks Stefan Behnel for the find.
parent
7a26cb97
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
26 deletions
+2
-26
Lib/test/test_unicode_file.py
Lib/test/test_unicode_file.py
+0
-26
Misc/NEWS
Misc/NEWS
+2
-0
No files found.
Lib/test/test_unicode_file.py
View file @
ed82ca10
...
...
@@ -51,22 +51,6 @@ class TestUnicodeFiles(unittest.TestCase):
self
.
assertIn
(
base
,
file_list
)
# Do as many "equivalancy' tests as we can - ie, check that although we
# have different types for the filename, they refer to the same file.
def
_do_equivalent
(
self
,
filename1
,
filename2
):
# Note we only check "filename1 against filename2" - we don't bother
# checking "filename2 against 1", as we assume we are called again with
# the args reversed.
self
.
assertTrue
(
type
(
filename1
)
!=
type
(
filename2
),
"No point checking equivalent filenames of the same type"
)
# stat and lstat should return the same results.
self
.
assertEqual
(
os
.
stat
(
filename1
),
os
.
stat
(
filename2
))
self
.
assertEqual
(
os
.
lstat
(
filename1
),
os
.
lstat
(
filename2
))
# Copy/rename etc tests using equivalent filename
self
.
_do_copyish
(
filename1
,
filename2
)
# Tests that copy, move, etc one file to another.
def
_do_copyish
(
self
,
filename1
,
filename2
):
# Should be able to rename the file using either name.
...
...
@@ -130,16 +114,6 @@ class TestUnicodeFiles(unittest.TestCase):
finally
:
os
.
unlink
(
filename
)
def
_test_equivalent
(
self
,
filename1
,
filename2
):
remove_if_exists
(
filename1
)
self
.
assertTrue
(
not
os
.
path
.
exists
(
filename2
))
f
=
file
(
filename1
,
"w"
)
f
.
close
()
try
:
self
.
_do_equivalent
(
filename1
,
filename2
)
finally
:
os
.
unlink
(
filename1
)
# The 'test' functions are unittest entry points, and simply call our
# _test functions with each of the filename combinations we wish to test
def
test_single_files
(
self
):
...
...
Misc/NEWS
View file @
ed82ca10
...
...
@@ -243,6 +243,8 @@ Tools/Demos
Tests
-----
- Issue #10294: Remove dead code form test_unicode_file.
- Issue #10123: Don't use non-ascii filenames in test_doctest tests. Add a
new test specific to unicode (non-ascii name and filename).
...
...
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