+++ /dev/null
-"""Tests for distutils.command.install."""\r
-\r
-import os\r
-import unittest\r
-\r
-from test.test_support import run_unittest\r
-\r
-from distutils.command.install import install\r
-from distutils.core import Distribution\r
-\r
-from distutils.tests import support\r
-\r
-\r
-class InstallTestCase(support.TempdirManager, unittest.TestCase):\r
-\r
- def test_home_installation_scheme(self):\r
- # This ensure two things:\r
- # - that --home generates the desired set of directory names\r
- # - test --home is supported on all platforms\r
- builddir = self.mkdtemp()\r
- destination = os.path.join(builddir, "installation")\r
-\r
- dist = Distribution({"name": "foopkg"})\r
- # script_name need not exist, it just need to be initialized\r
- dist.script_name = os.path.join(builddir, "setup.py")\r
- dist.command_obj["build"] = support.DummyCommand(\r
- build_base=builddir,\r
- build_lib=os.path.join(builddir, "lib"),\r
- )\r
-\r
- cmd = install(dist)\r
- cmd.home = destination\r
- cmd.ensure_finalized()\r
-\r
- self.assertEqual(cmd.install_base, destination)\r
- self.assertEqual(cmd.install_platbase, destination)\r
-\r
- def check_path(got, expected):\r
- got = os.path.normpath(got)\r
- expected = os.path.normpath(expected)\r
- self.assertEqual(got, expected)\r
-\r
- libdir = os.path.join(destination, "lib", "python")\r
- check_path(cmd.install_lib, libdir)\r
- check_path(cmd.install_platlib, libdir)\r
- check_path(cmd.install_purelib, libdir)\r
- check_path(cmd.install_headers,\r
- os.path.join(destination, "include", "python", "foopkg"))\r
- check_path(cmd.install_scripts, os.path.join(destination, "bin"))\r
- check_path(cmd.install_data, destination)\r
-\r
-\r
-def test_suite():\r
- return unittest.makeSuite(InstallTestCase)\r
-\r
-if __name__ == "__main__":\r
- run_unittest(test_suite())\r