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
e616c53a
Kaydet (Commit)
e616c53a
authored
Haz 04, 2009
tarafından
Tarek Ziadé
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
improved test coverage for distutils.command.install and cleaned it up
üst
064a381a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
72 additions
and
1 deletion
+72
-1
install.py
Lib/distutils/command/install.py
+0
-0
test_install.py
Lib/distutils/tests/test_install.py
+72
-1
No files found.
Lib/distutils/command/install.py
Dosyayı görüntüle @
e616c53a
This diff is collapsed.
Click to expand it.
Lib/distutils/tests/test_install.py
Dosyayı görüntüle @
e616c53a
...
...
@@ -10,11 +10,14 @@ from distutils.command.install import install
from
distutils.command
import
install
as
install_module
from
distutils.command.install
import
INSTALL_SCHEMES
from
distutils.core
import
Distribution
from
distutils.errors
import
DistutilsOptionError
from
distutils.tests
import
support
class
InstallTestCase
(
support
.
TempdirManager
,
unittest
.
TestCase
):
class
InstallTestCase
(
support
.
TempdirManager
,
support
.
LoggingSilencer
,
unittest
.
TestCase
):
def
test_home_installation_scheme
(
self
):
# This ensure two things:
...
...
@@ -112,6 +115,74 @@ class InstallTestCase(support.TempdirManager, unittest.TestCase):
self
.
assert_
(
'userbase'
in
cmd
.
config_vars
)
self
.
assert_
(
'usersite'
in
cmd
.
config_vars
)
def
test_handle_extra_path
(
self
):
dist
=
Distribution
({
'name'
:
'xx'
,
'extra_path'
:
'path,dirs'
})
cmd
=
install
(
dist
)
# two elements
cmd
.
handle_extra_path
()
self
.
assertEquals
(
cmd
.
extra_path
,
[
'path'
,
'dirs'
])
self
.
assertEquals
(
cmd
.
extra_dirs
,
'dirs'
)
self
.
assertEquals
(
cmd
.
path_file
,
'path'
)
# one element
cmd
.
extra_path
=
[
'path'
]
cmd
.
handle_extra_path
()
self
.
assertEquals
(
cmd
.
extra_path
,
[
'path'
])
self
.
assertEquals
(
cmd
.
extra_dirs
,
'path'
)
self
.
assertEquals
(
cmd
.
path_file
,
'path'
)
# none
dist
.
extra_path
=
cmd
.
extra_path
=
None
cmd
.
handle_extra_path
()
self
.
assertEquals
(
cmd
.
extra_path
,
None
)
self
.
assertEquals
(
cmd
.
extra_dirs
,
''
)
self
.
assertEquals
(
cmd
.
path_file
,
None
)
# three elements (no way !)
cmd
.
extra_path
=
'path,dirs,again'
self
.
assertRaises
(
DistutilsOptionError
,
cmd
.
handle_extra_path
)
def
test_finalize_options
(
self
):
dist
=
Distribution
({
'name'
:
'xx'
})
cmd
=
install
(
dist
)
# must supply either prefix/exec-prefix/home or
# install-base/install-platbase -- not both
cmd
.
prefix
=
'prefix'
cmd
.
install_base
=
'base'
self
.
assertRaises
(
DistutilsOptionError
,
cmd
.
finalize_options
)
# must supply either home or prefix/exec-prefix -- not both
cmd
.
install_base
=
None
cmd
.
home
=
'home'
self
.
assertRaises
(
DistutilsOptionError
,
cmd
.
finalize_options
)
# can't combine user with with prefix/exec_prefix/home or
# install_(plat)base
cmd
.
prefix
=
None
cmd
.
user
=
'user'
self
.
assertRaises
(
DistutilsOptionError
,
cmd
.
finalize_options
)
def
test_record
(
self
):
install_dir
=
self
.
mkdtemp
()
pkgdir
,
dist
=
self
.
create_dist
()
dist
=
Distribution
()
cmd
=
install
(
dist
)
dist
.
command_obj
[
'install'
]
=
cmd
cmd
.
root
=
install_dir
cmd
.
record
=
os
.
path
.
join
(
pkgdir
,
'RECORD'
)
cmd
.
ensure_finalized
()
cmd
.
run
()
# let's check the RECORD file was created with one
# line (the egg info file)
with
open
(
cmd
.
record
)
as
f
:
self
.
assertEquals
(
len
(
f
.
readlines
()),
1
)
def
test_suite
():
return
unittest
.
makeSuite
(
InstallTestCase
)
...
...
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