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
064a7681
Kaydet (Commit)
064a7681
authored
May 14, 2009
tarafından
Tarek Ziadé
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
more test coverage for distutils sdist command
üst
51d06abc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
4 deletions
+17
-4
sdist.py
Lib/distutils/command/sdist.py
+3
-4
test_sdist.py
Lib/distutils/tests/test_sdist.py
+14
-0
No files found.
Lib/distutils/command/sdist.py
Dosyayı görüntüle @
064a7681
...
@@ -16,19 +16,18 @@ from distutils.filelist import FileList
...
@@ -16,19 +16,18 @@ from distutils.filelist import FileList
from
distutils
import
log
from
distutils
import
log
from
distutils.util
import
convert_path
from
distutils.util
import
convert_path
def
show_formats
():
def
show_formats
():
"""Print all possible values for the 'formats' option (used by
"""Print all possible values for the 'formats' option (used by
the "--help-formats" command-line option).
the "--help-formats" command-line option).
"""
"""
from
distutils.fancy_getopt
import
FancyGetopt
from
distutils.fancy_getopt
import
FancyGetopt
from
distutils.archive_util
import
ARCHIVE_FORMATS
from
distutils.archive_util
import
ARCHIVE_FORMATS
formats
=
[]
formats
=
[]
for
format
in
ARCHIVE_FORMATS
.
keys
():
for
format
in
ARCHIVE_FORMATS
.
keys
():
formats
.
append
((
"formats="
+
format
,
None
,
formats
.
append
((
"formats="
+
format
,
None
,
ARCHIVE_FORMATS
[
format
][
2
]))
ARCHIVE_FORMATS
[
format
][
2
]))
formats
.
sort
()
formats
.
sort
()
pretty_printer
=
FancyGetopt
(
formats
)
FancyGetopt
(
formats
)
.
print_help
(
pretty_printer
.
print_help
(
"List of available source distribution formats:"
)
"List of available source distribution formats:"
)
class
sdist
(
Command
):
class
sdist
(
Command
):
...
...
Lib/distutils/tests/test_sdist.py
Dosyayı görüntüle @
064a7681
...
@@ -7,12 +7,16 @@ from os.path import join
...
@@ -7,12 +7,16 @@ from os.path import join
import
sys
import
sys
import
tempfile
import
tempfile
from
test.test_support
import
captured_stdout
from
distutils.command.sdist
import
sdist
from
distutils.command.sdist
import
sdist
from
distutils.command.sdist
import
show_formats
from
distutils.core
import
Distribution
from
distutils.core
import
Distribution
from
distutils.tests.test_config
import
PyPIRCCommandTestCase
from
distutils.tests.test_config
import
PyPIRCCommandTestCase
from
distutils.errors
import
DistutilsExecError
from
distutils.errors
import
DistutilsExecError
from
distutils.spawn
import
find_executable
from
distutils.spawn
import
find_executable
from
distutils.tests
import
support
from
distutils.tests
import
support
from
distutils.archive_util
import
ARCHIVE_FORMATS
SETUP_PY
=
"""
SETUP_PY
=
"""
from distutils.core import setup
from distutils.core import setup
...
@@ -210,6 +214,16 @@ class sdistTestCase(PyPIRCCommandTestCase):
...
@@ -210,6 +214,16 @@ class sdistTestCase(PyPIRCCommandTestCase):
manifest
=
open
(
join
(
self
.
tmp_dir
,
'MANIFEST'
))
.
read
()
manifest
=
open
(
join
(
self
.
tmp_dir
,
'MANIFEST'
))
.
read
()
self
.
assertEquals
(
manifest
,
MANIFEST
%
{
'sep'
:
os
.
sep
})
self
.
assertEquals
(
manifest
,
MANIFEST
%
{
'sep'
:
os
.
sep
})
def
test_show_formats
(
self
):
with
captured_stdout
()
as
stdout
:
show_formats
()
# the output should be a header line + one line per format
num_formats
=
len
(
ARCHIVE_FORMATS
.
keys
())
output
=
[
line
for
line
in
stdout
.
getvalue
()
.
split
(
'
\n
'
)
if
line
.
strip
()
.
startswith
(
'--formats='
)]
self
.
assertEquals
(
len
(
output
),
num_formats
)
def
test_suite
():
def
test_suite
():
return
unittest
.
makeSuite
(
sdistTestCase
)
return
unittest
.
makeSuite
(
sdistTestCase
)
...
...
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