diff options
| author | Pierre Paul <info@pierre-paul.com> | 2012-05-12 15:03:53 -0400 |
|---|---|---|
| committer | Pierre Paul <info@pierre-paul.com> | 2012-05-12 15:03:53 -0400 |
| commit | cd397fbf10519abaf593edc5366a786356286142 (patch) | |
| tree | c812d5b8af6a1d20ad0f6b64209d675fdeb79e25 /distutils2/tests/test_install.py | |
| parent | 4b00f4377f8f634410a43c36bf7748d5a3ad353b (diff) | |
| parent | 60a0f846b2bd3729661328461ce2f1db6a98d5de (diff) | |
| download | disutils2-cd397fbf10519abaf593edc5366a786356286142.tar.gz | |
Merge
Diffstat (limited to 'distutils2/tests/test_install.py')
| -rw-r--r-- | distutils2/tests/test_install.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/distutils2/tests/test_install.py b/distutils2/tests/test_install.py index cb1d499..f613b22 100644 --- a/distutils2/tests/test_install.py +++ b/distutils2/tests/test_install.py @@ -1,6 +1,8 @@ """Tests for the distutils2.install module.""" import os import logging +import sys + from tempfile import mkstemp from distutils2 import install @@ -258,6 +260,26 @@ class TestInstall(LoggingCatcher, TempdirManager, unittest.TestCase): for key in expect: self.assertEqual(expect[key], dict1[key]) + def test_install_custom_dir(self): + dest = self.mkdtemp() + src = self.mkdtemp() + + project_dir, dist = self.create_dist( + name='Spamlib', version='0.1', + data_files={'spamd': '{scripts}/spamd'}) + + dist.name = MagicMock(return_value='Spamlib') + dist.version = MagicMock(return_value='0.1') + dist.unpack = MagicMock(return_value=project_dir) + + self.write_file([project_dir, 'setup.cfg'], + ("[metadata]\n" + "name = mypackage\n" + "version = 0.1.0\n")) + + install.install_from_infos(dest, install=[dist]) + self.assertEqual(len(os.listdir(dest)), 1) + def test_install_dists_rollback(self): # if one of the distribution installation fails, call uninstall on all # installed distributions. |
