diff options
author | Éric Araujo <merwok@netwok.org> | 2011-11-03 05:00:02 (GMT) |
---|---|---|
committer | Éric Araujo <merwok@netwok.org> | 2011-11-03 05:00:02 (GMT) |
commit | 7855a1abec947dfb05fbb79393d972af02403bab (patch) | |
tree | d827811c6aec9fd3cabe81ce2ef46a641992c796 /Lib/packaging | |
parent | e64052176d998a0f1397fc5fa60875e2f0371296 (diff) | |
download | cpython-7855a1abec947dfb05fbb79393d972af02403bab.zip cpython-7855a1abec947dfb05fbb79393d972af02403bab.tar.gz cpython-7855a1abec947dfb05fbb79393d972af02403bab.tar.bz2 |
Actually check the contents of the file created by packaging’s bdist_dumb
Diffstat (limited to 'Lib/packaging')
-rw-r--r-- | Lib/packaging/tests/test_command_bdist_dumb.py | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/Lib/packaging/tests/test_command_bdist_dumb.py b/Lib/packaging/tests/test_command_bdist_dumb.py index 8e2d497..15cf658 100644 --- a/Lib/packaging/tests/test_command_bdist_dumb.py +++ b/Lib/packaging/tests/test_command_bdist_dumb.py @@ -1,6 +1,9 @@ """Tests for distutils.command.bdist_dumb.""" import os +import imp +import sys +import zipfile import packaging.util from packaging.dist import Distribution @@ -49,15 +52,21 @@ class BuildDumbTestCase(support.TempdirManager, # see what we have dist_created = os.listdir(os.path.join(pkg_dir, 'dist')) - base = "%s.%s" % (dist.get_fullname(), cmd.plat_name) + base = "%s.%s.zip" % (dist.get_fullname(), cmd.plat_name) if os.name == 'os2': base = base.replace(':', '-') - wanted = ['%s.zip' % base] - self.assertEqual(dist_created, wanted) + self.assertEqual(dist_created, [base]) # now let's check what we have in the zip file - # XXX to be done + with zipfile.ZipFile(os.path.join('dist', base)) as fp: + contents = fp.namelist() + + contents = sorted(os.path.basename(fn) for fn in contents) + wanted = ['foo.py', + 'foo.%s.pyc' % imp.get_tag(), + 'METADATA', 'INSTALLER', 'REQUESTED', 'RECORD'] + self.assertEqual(contents, sorted(wanted)) def test_finalize_options(self): pkg_dir, dist = self.create_dist() |