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
fa23cc84
Commit
fa23cc84
authored
Oct 06, 2011
by
Éric Araujo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test that was promised in a comment but not actually written
parent
9556a5ba
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
Lib/packaging/tests/test_uninstall.py
Lib/packaging/tests/test_uninstall.py
+7
-2
No files found.
Lib/packaging/tests/test_uninstall.py
View file @
fa23cc84
"""Tests for the uninstall command."""
import
os
import
sys
import
logging
from
io
import
StringIO
import
stat
import
packaging.util
...
...
@@ -105,14 +106,14 @@ class UninstallTestCase(support.TempdirManager,
def
test_remove_issue
(
self
):
# makes sure if there are OSErrors (like permission denied)
# remove() stops and display a clean error
# remove() stops and display
s
a clean error
dist
,
site_packages
=
self
.
install_dist
(
'Meh'
)
# breaking os.rename
old
=
os
.
rename
def
_rename
(
source
,
target
):
raise
OSError
raise
OSError
(
42
,
'impossible operation'
)
os
.
rename
=
_rename
try
:
...
...
@@ -120,6 +121,10 @@ class UninstallTestCase(support.TempdirManager,
finally
:
os
.
rename
=
old
logs
=
[
log
for
log
in
self
.
get_logs
(
logging
.
INFO
)
if
log
.
startswith
(
'Error:'
)]
self
.
assertEqual
(
logs
,
[
'Error: [Errno 42] impossible operation'
])
self
.
assertTrue
(
remove
(
'Meh'
,
paths
=
[
site_packages
]))
...
...
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