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