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
746e72d5
Kaydet (Commit)
746e72d5
authored
Agu 20, 2011
tarafından
Éric Araujo
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Rework test_old_record a bit to make the test more exact
(i.e. to check the files found are what we expect)
üst
60b0d31e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
13 deletions
+13
-13
test_command_install_dist.py
Lib/packaging/tests/test_command_install_dist.py
+13
-13
No files found.
Lib/packaging/tests/test_command_install_dist.py
Dosyayı görüntüle @
746e72d5
...
...
@@ -2,22 +2,19 @@
import
os
import
sys
from
sysconfig
import
(
get_scheme_names
,
get_config_vars
,
_SCHEMES
,
get_config_var
,
get_path
)
_CONFIG_VARS
=
get_config_vars
()
from
packaging.tests
import
captured_stdout
from
packaging.command.install_dist
import
install_dist
from
packaging.command
import
install_dist
as
install_module
from
packaging.dist
import
Distribution
from
packaging.errors
import
PackagingOptionError
from
packaging.tests
import
unittest
,
support
_CONFIG_VARS
=
get_config_vars
()
class
InstallTestCase
(
support
.
TempdirManager
,
support
.
LoggingCatcher
,
unittest
.
TestCase
):
...
...
@@ -178,21 +175,24 @@ class InstallTestCase(support.TempdirManager,
def
test_old_record
(
self
):
# test pre-PEP 376 --record option (outside dist-info dir)
install_dir
=
self
.
mkdtemp
()
pkgdir
,
dist
=
self
.
create_dist
()
project_dir
,
dist
=
self
.
create_dist
(
scripts
=
[
'hello'
])
#self.addCleanup(os.chdir, os.getcwd())
os
.
chdir
(
project_dir
)
self
.
write_file
(
'hello'
,
"print('o hai')"
)
dist
=
Distribution
()
cmd
=
install_dist
(
dist
)
dist
.
command_obj
[
'install_dist'
]
=
cmd
cmd
.
root
=
install_dir
cmd
.
record
=
os
.
path
.
join
(
p
kg
dir
,
'filelist'
)
cmd
.
record
=
os
.
path
.
join
(
p
roject_
dir
,
'filelist'
)
cmd
.
ensure_finalized
()
cmd
.
run
()
# let's check the record file was created with four
# lines, one for each .dist-info entry: METADATA,
# INSTALLER, REQUSTED, RECORD
with
open
(
cmd
.
record
)
as
f
:
self
.
assertEqual
(
len
(
f
.
readlines
()),
4
)
content
=
f
.
read
()
found
=
[
os
.
path
.
basename
(
line
)
for
line
in
content
.
splitlines
()]
expected
=
[
'hello'
,
'METADATA'
,
'INSTALLER'
,
'REQUESTED'
,
'RECORD'
]
self
.
assertEqual
(
found
,
expected
)
# XXX test that fancy_getopt is okay with options named
# record and no-record but unrelated
...
...
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