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
641b1de2
Kaydet (Commit)
641b1de2
authored
Eki 02, 2009
tarafından
Tarek Ziadé
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
fixed the distutils tests that were not writing in temp
üst
d3c87657
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
28 deletions
+24
-28
test_config.py
Lib/distutils/tests/test_config.py
+5
-5
test_sdist.py
Lib/distutils/tests/test_sdist.py
+19
-23
No files found.
Lib/distutils/tests/test_config.py
Dosyayı görüntüle @
641b1de2
...
...
@@ -49,13 +49,14 @@ class PyPIRCCommandTestCase(support.TempdirManager, unittest.TestCase):
def
setUp
(
self
):
"""Patches the environment."""
super
(
PyPIRCCommandTestCase
,
self
)
.
setUp
()
if
os
.
environ
.
has_key
(
'HOME'
):
self
.
_old_home
=
os
.
environ
[
'HOME'
]
else
:
self
.
_old_home
=
None
curdir
=
os
.
path
.
dirname
(
__file__
)
os
.
environ
[
'HOME'
]
=
cur
dir
self
.
rc
=
os
.
path
.
join
(
cur
dir
,
'.pypirc'
)
tempdir
=
self
.
mkdtemp
(
)
os
.
environ
[
'HOME'
]
=
temp
dir
self
.
rc
=
os
.
path
.
join
(
temp
dir
,
'.pypirc'
)
self
.
dist
=
Distribution
()
class
command
(
PyPIRCCommand
):
...
...
@@ -74,9 +75,8 @@ class PyPIRCCommandTestCase(support.TempdirManager, unittest.TestCase):
del
os
.
environ
[
'HOME'
]
else
:
os
.
environ
[
'HOME'
]
=
self
.
_old_home
if
os
.
path
.
exists
(
self
.
rc
):
os
.
remove
(
self
.
rc
)
set_threshold
(
self
.
old_threshold
)
super
(
PyPIRCCommandTestCase
,
self
)
.
tearDown
()
def
test_server_registration
(
self
):
# This test makes sure PyPIRCCommand knows how to:
...
...
Lib/distutils/tests/test_sdist.py
Dosyayı görüntüle @
641b1de2
...
...
@@ -12,9 +12,6 @@ from distutils.tests.test_config import PyPIRCCommandTestCase
from
distutils.errors
import
DistutilsExecError
from
distutils.spawn
import
find_executable
CURDIR
=
os
.
path
.
dirname
(
__file__
)
TEMP_PKG
=
join
(
CURDIR
,
'temppkg'
)
SETUP_PY
=
"""
from distutils.core import setup
import somecode
...
...
@@ -31,25 +28,24 @@ class sdistTestCase(PyPIRCCommandTestCase):
def
setUp
(
self
):
super
(
sdistTestCase
,
self
)
.
setUp
()
self
.
old_path
=
os
.
getcwd
()
self
.
temp_pkg
=
os
.
path
.
join
(
self
.
mkdtemp
(),
'temppkg'
)
def
tearDown
(
self
):
os
.
chdir
(
self
.
old_path
)
if
os
.
path
.
exists
(
TEMP_PKG
):
shutil
.
rmtree
(
TEMP_PKG
)
super
(
sdistTestCase
,
self
)
.
tearDown
()
def
_init_tmp_pkg
(
self
):
if
os
.
path
.
exists
(
TEMP_PKG
):
shutil
.
rmtree
(
TEMP_PKG
)
os
.
mkdir
(
TEMP_PKG
)
os
.
mkdir
(
join
(
TEMP_PKG
,
'somecode'
))
os
.
mkdir
(
join
(
TEMP_PKG
,
'dist'
))
if
os
.
path
.
exists
(
self
.
temp_pkg
):
shutil
.
rmtree
(
self
.
temp_pkg
)
os
.
mkdir
(
self
.
temp_pkg
)
os
.
mkdir
(
join
(
self
.
temp_pkg
,
'somecode'
))
os
.
mkdir
(
join
(
self
.
temp_pkg
,
'dist'
))
# creating a MANIFEST, a package, and a README
self
.
_write
(
join
(
TEMP_PKG
,
'MANIFEST.in'
),
MANIFEST_IN
)
self
.
_write
(
join
(
TEMP_PKG
,
'README'
),
'xxx'
)
self
.
_write
(
join
(
TEMP_PKG
,
'somecode'
,
'__init__.py'
),
'#'
)
self
.
_write
(
join
(
TEMP_PKG
,
'setup.py'
),
SETUP_PY
)
os
.
chdir
(
TEMP_PKG
)
self
.
_write
(
join
(
self
.
temp_pkg
,
'MANIFEST.in'
),
MANIFEST_IN
)
self
.
_write
(
join
(
self
.
temp_pkg
,
'README'
),
'xxx'
)
self
.
_write
(
join
(
self
.
temp_pkg
,
'somecode'
,
'__init__.py'
),
'#'
)
self
.
_write
(
join
(
self
.
temp_pkg
,
'setup.py'
),
SETUP_PY
)
os
.
chdir
(
self
.
temp_pkg
)
def
_write
(
self
,
path
,
content
):
f
=
open
(
path
,
'w'
)
...
...
@@ -65,15 +61,15 @@ class sdistTestCase(PyPIRCCommandTestCase):
self
.
_init_tmp_pkg
()
# creating VCS directories with some files in them
os
.
mkdir
(
join
(
TEMP_PKG
,
'somecode'
,
'.svn'
))
self
.
_write
(
join
(
TEMP_PKG
,
'somecode'
,
'.svn'
,
'ok.py'
),
'xxx'
)
os
.
mkdir
(
join
(
self
.
temp_pkg
,
'somecode'
,
'.svn'
))
self
.
_write
(
join
(
self
.
temp_pkg
,
'somecode'
,
'.svn'
,
'ok.py'
),
'xxx'
)
os
.
mkdir
(
join
(
TEMP_PKG
,
'somecode'
,
'.hg'
))
self
.
_write
(
join
(
TEMP_PKG
,
'somecode'
,
'.hg'
,
os
.
mkdir
(
join
(
self
.
temp_pkg
,
'somecode'
,
'.hg'
))
self
.
_write
(
join
(
self
.
temp_pkg
,
'somecode'
,
'.hg'
,
'ok'
),
'xxx'
)
os
.
mkdir
(
join
(
TEMP_PKG
,
'somecode'
,
'.git'
))
self
.
_write
(
join
(
TEMP_PKG
,
'somecode'
,
'.git'
,
os
.
mkdir
(
join
(
self
.
temp_pkg
,
'somecode'
,
'.git'
))
self
.
_write
(
join
(
self
.
temp_pkg
,
'somecode'
,
'.git'
,
'ok'
),
'xxx'
)
# now building a sdist
...
...
@@ -96,7 +92,7 @@ class sdistTestCase(PyPIRCCommandTestCase):
cmd
.
run
()
# now let's check what we have
dist_folder
=
join
(
TEMP_PKG
,
'dist'
)
dist_folder
=
join
(
self
.
temp_pkg
,
'dist'
)
files
=
os
.
listdir
(
dist_folder
)
self
.
assertEquals
(
files
,
[
'fake-1.0.zip'
])
...
...
@@ -137,7 +133,7 @@ class sdistTestCase(PyPIRCCommandTestCase):
cmd
.
run
()
# making sure we have two files
dist_folder
=
join
(
TEMP_PKG
,
'dist'
)
dist_folder
=
join
(
self
.
temp_pkg
,
'dist'
)
result
=
os
.
listdir
(
dist_folder
)
result
.
sort
()
self
.
assertEquals
(
result
,
...
...
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