]>
git.proxmox.com Git - mirror_edk2.git/blob - AppPkg/Applications/Python/Python-2.7.2/Lib/distutils/tests/test_install.py
3ebae2dcd5dc719bd171222e82f145f16451ff99
1 """Tests for distutils.command.install."""
6 from test
.test_support
import run_unittest
8 from distutils
.command
.install
import install
9 from distutils
.core
import Distribution
11 from distutils
.tests
import support
14 class InstallTestCase(support
.TempdirManager
, unittest
.TestCase
):
16 def test_home_installation_scheme(self
):
17 # This ensure two things:
18 # - that --home generates the desired set of directory names
19 # - test --home is supported on all platforms
20 builddir
= self
.mkdtemp()
21 destination
= os
.path
.join(builddir
, "installation")
23 dist
= Distribution({"name": "foopkg"})
24 # script_name need not exist, it just need to be initialized
25 dist
.script_name
= os
.path
.join(builddir
, "setup.py")
26 dist
.command_obj
["build"] = support
.DummyCommand(
28 build_lib
=os
.path
.join(builddir
, "lib"),
32 cmd
.home
= destination
33 cmd
.ensure_finalized()
35 self
.assertEqual(cmd
.install_base
, destination
)
36 self
.assertEqual(cmd
.install_platbase
, destination
)
38 def check_path(got
, expected
):
39 got
= os
.path
.normpath(got
)
40 expected
= os
.path
.normpath(expected
)
41 self
.assertEqual(got
, expected
)
43 libdir
= os
.path
.join(destination
, "lib", "python")
44 check_path(cmd
.install_lib
, libdir
)
45 check_path(cmd
.install_platlib
, libdir
)
46 check_path(cmd
.install_purelib
, libdir
)
47 check_path(cmd
.install_headers
,
48 os
.path
.join(destination
, "include", "python", "foopkg"))
49 check_path(cmd
.install_scripts
, os
.path
.join(destination
, "bin"))
50 check_path(cmd
.install_data
, destination
)
54 return unittest
.makeSuite(InstallTestCase
)
56 if __name__
== "__main__":
57 run_unittest(test_suite())