diff options
| author | Tarek Ziadé <ziade.tarek@gmail.com> | 2009-12-20 23:54:52 (GMT) |
|---|---|---|
| committer | Tarek Ziadé <ziade.tarek@gmail.com> | 2009-12-20 23:54:52 (GMT) |
| commit | e220d6793970e2ee0d71c5faa9cb712a4fe15de4 (patch) | |
| tree | 85a380fec171c7e424b86686f3db3415c337eef3 /Lib/distutils/tests/support.py | |
| parent | 59a389898efe8c55a344c01b1af61d315e216c86 (diff) | |
| download | cpython-e220d6793970e2ee0d71c5faa9cb712a4fe15de4.zip cpython-e220d6793970e2ee0d71c5faa9cb712a4fe15de4.tar.gz cpython-e220d6793970e2ee0d71c5faa9cb712a4fe15de4.tar.bz2 | |
Merged revisions 76952 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r76952 | tarek.ziade | 2009-12-21 00:23:34 +0100 (Mon, 21 Dec 2009) | 1 line
Fixed #7552: fixed distutils.command.upload failure on very long passwords
........
Diffstat (limited to 'Lib/distutils/tests/support.py')
| -rw-r--r-- | Lib/distutils/tests/support.py | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/Lib/distutils/tests/support.py b/Lib/distutils/tests/support.py index d24a18e..9d373e9 100644 --- a/Lib/distutils/tests/support.py +++ b/Lib/distutils/tests/support.py @@ -1,10 +1,10 @@ """Support code for distutils test cases.""" - +import os import shutil import tempfile from distutils import log - +from distutils.dist import Distribution class LoggingSilencer(object): @@ -55,6 +55,23 @@ class TempdirManager(object): finally: f.close() + def create_dist(self, pkg_name='foo', **kw): + """Will generate a test environment. + + This function creates: + - a Distribution instance using keywords + - a temporary directory with a package structure + + It returns the package directory and the distribution + instance. + """ + tmp_dir = self.mkdtemp() + pkg_dir = os.path.join(tmp_dir, pkg_name) + os.mkdir(pkg_dir) + dist = Distribution(attrs=kw) + + return pkg_dir, dist + class DummyCommand: """Class to store options for retrieval via set_undefined_options().""" |
