diff options
author | Éric Araujo <merwok@netwok.org> | 2011-08-25 16:13:58 (GMT) |
---|---|---|
committer | Éric Araujo <merwok@netwok.org> | 2011-08-25 16:13:58 (GMT) |
commit | ced7eda71721b595544e56484e6e08a34ae2311d (patch) | |
tree | 5055a597d99eb281757cb9e9b12d4af92d0e13bf /Lib/packaging | |
parent | 0a95b43723765375277010f6ea134d6fb547dcdb (diff) | |
download | cpython-ced7eda71721b595544e56484e6e08a34ae2311d.zip cpython-ced7eda71721b595544e56484e6e08a34ae2311d.tar.gz cpython-ced7eda71721b595544e56484e6e08a34ae2311d.tar.bz2 |
Another (hopefully last) fix for test_packaging on Windws (#12678)
Diffstat (limited to 'Lib/packaging')
-rw-r--r-- | Lib/packaging/tests/test_command_install_distinfo.py | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/Lib/packaging/tests/test_command_install_distinfo.py b/Lib/packaging/tests/test_command_install_distinfo.py index 994cdd8..31636fd 100644 --- a/Lib/packaging/tests/test_command_install_distinfo.py +++ b/Lib/packaging/tests/test_command_install_distinfo.py @@ -138,7 +138,7 @@ class InstallDistinfoTestCase(support.TempdirManager, os.chdir(project_dir) self.write_file('spam', '# Python module') self.write_file('spamd', '# Python script') - extmod = '_speedspam%s' % sysconfig.get_config_var('SO') + extmod = '_speedspam' + sysconfig.get_config_var('SO') self.write_file(extmod, '') install = DummyInstallCmd(dist) @@ -152,6 +152,16 @@ class InstallDistinfoTestCase(support.TempdirManager, dist.command_obj['install_distinfo'] = cmd cmd.run() + # checksum and size are not hard-coded for METADATA as it is + # platform-dependent (line endings) + metadata = os.path.join(modules_dest, 'Spamlib-0.1.dist-info', + 'METADATA') + with open(metadata, 'rb') as fp: + content = fp.read() + + metadata_size = str(len(content)) + metadata_md5 = hashlib.md5(content).hexdigest() + record = os.path.join(modules_dest, 'Spamlib-0.1.dist-info', 'RECORD') with open(record, encoding='utf-8') as fp: content = fp.read() @@ -164,9 +174,9 @@ class InstallDistinfoTestCase(support.TempdirManager, expected = [ ('spam', '6ab2f288ef2545868effe68757448b45', '15'), - ('spamd','d13e6156ce78919a981e424b2fdcd974', '15'), + ('spamd', 'd13e6156ce78919a981e424b2fdcd974', '15'), (extmod, 'd41d8cd98f00b204e9800998ecf8427e', '0'), - ('METADATA', '846de67e49c3b92c81fb1ebd7bc07046', '172'), + ('METADATA', metadata_md5, metadata_size), ('INSTALLER', '44e3fde05f3f537ed85831969acf396d', '9'), ('REQUESTED', 'd41d8cd98f00b204e9800998ecf8427e', '0'), ('RECORD', '', ''), |