diff options
| author | Konrad Delong <konryd@gmail.com> | 2010-08-16 11:52:12 +0200 |
|---|---|---|
| committer | Konrad Delong <konryd@gmail.com> | 2010-08-16 11:52:12 +0200 |
| commit | b47bd1c023f37a011958666b2136188820428bce (patch) | |
| tree | a2be23e54d16ab6e0de7a861222dd0acef2c634c /src/distutils2 | |
| parent | b6d2cb35cea6fedff65f5ddeb6d67411eee08f49 (diff) | |
| download | disutils2-b47bd1c023f37a011958666b2136188820428bce.tar.gz | |
added back tests removed in a recent merge
Diffstat (limited to 'src/distutils2')
| -rw-r--r-- | src/distutils2/tests/test_dist.py | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/distutils2/tests/test_dist.py b/src/distutils2/tests/test_dist.py index ba86274..fe28b6b 100644 --- a/src/distutils2/tests/test_dist.py +++ b/src/distutils2/tests/test_dist.py @@ -327,6 +327,43 @@ class DistributionTestCase(support.TempdirManager, 'run', 'post-test_dist']) + def test_hooks_importable(self): + temp_home = self.mkdtemp() + config_file = os.path.join(temp_home, "config1.cfg") + + self.write_file(config_file, textwrap.dedent(''' + [test_dist] + pre-hook.test = nonexistent.dotted.name''')) + + sys.argv.extend(["--command-packages", + "distutils2.tests", + "test_dist"]) + + d = self.create_distribution([config_file]) + cmd = d.get_command_obj("test_dist") + cmd.ensure_finalized() + + self.assertRaises(DistutilsModuleError, d.run_command, 'test_dist') + + def test_hooks_callable(self): + temp_home = self.mkdtemp() + config_file = os.path.join(temp_home, "config1.cfg") + + self.write_file(config_file, textwrap.dedent(''' + [test_dist] + pre-hook.test = distutils2.tests.test_dist.__doc__''')) + + sys.argv.extend(["--command-packages", + "distutils2.tests", + "test_dist"]) + + d = self.create_distribution([config_file]) + cmd = d.get_command_obj("test_dist") + cmd.ensure_finalized() + + self.assertRaises(DistutilsOptionError, d.run_command, 'test_dist') + + class MetadataTestCase(support.TempdirManager, support.EnvironGuard, support.LoggingCatcher, unittest.TestCase): |
