Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
fa23cc84
Kaydet (Commit)
fa23cc84
authored
Eki 06, 2011
tarafından
Éric Araujo
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add test that was promised in a comment but not actually written
üst
9556a5ba
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
test_uninstall.py
Lib/packaging/tests/test_uninstall.py
+7
-2
No files found.
Lib/packaging/tests/test_uninstall.py
Dosyayı görüntüle @
fa23cc84
"""Tests for the uninstall command."""
"""Tests for the uninstall command."""
import
os
import
os
import
sys
import
sys
import
logging
from
io
import
StringIO
from
io
import
StringIO
import
stat
import
stat
import
packaging.util
import
packaging.util
...
@@ -105,14 +106,14 @@ class UninstallTestCase(support.TempdirManager,
...
@@ -105,14 +106,14 @@ class UninstallTestCase(support.TempdirManager,
def
test_remove_issue
(
self
):
def
test_remove_issue
(
self
):
# makes sure if there are OSErrors (like permission denied)
# 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'
)
dist
,
site_packages
=
self
.
install_dist
(
'Meh'
)
# breaking os.rename
# breaking os.rename
old
=
os
.
rename
old
=
os
.
rename
def
_rename
(
source
,
target
):
def
_rename
(
source
,
target
):
raise
OSError
raise
OSError
(
42
,
'impossible operation'
)
os
.
rename
=
_rename
os
.
rename
=
_rename
try
:
try
:
...
@@ -120,6 +121,10 @@ class UninstallTestCase(support.TempdirManager,
...
@@ -120,6 +121,10 @@ class UninstallTestCase(support.TempdirManager,
finally
:
finally
:
os
.
rename
=
old
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
]))
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