summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/tests/test_sdist.py
diff options
context:
space:
mode:
authorTarek Ziadé <ziade.tarek@gmail.com>2010-05-17 10:48:29 (GMT)
committerTarek Ziadé <ziade.tarek@gmail.com>2010-05-17 10:48:29 (GMT)
commitdd4671a93eee8d4a9d121bb1b44bffb11c083560 (patch)
tree724ef85752bdc53a39080f718b94f949b0579947 /Lib/distutils/tests/test_sdist.py
parent2e71d014ea9e22c846b459e6420e5ef2c726ac76 (diff)
downloadcpython-dd4671a93eee8d4a9d121bb1b44bffb11c083560.zip
cpython-dd4671a93eee8d4a9d121bb1b44bffb11c083560.tar.gz
cpython-dd4671a93eee8d4a9d121bb1b44bffb11c083560.tar.bz2
Merged revisions 81258 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r81258 | tarek.ziade | 2010-05-17 12:38:53 +0200 (Mon, 17 May 2010) | 9 lines Merged revisions 81255 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r81255 | tarek.ziade | 2010-05-17 12:06:20 +0200 (Mon, 17 May 2010) | 1 line Fixed #8688: Distutils now recalculates MANIFEST everytime. ........ ................
Diffstat (limited to 'Lib/distutils/tests/test_sdist.py')
-rw-r--r--Lib/distutils/tests/test_sdist.py41
1 files changed, 41 insertions, 0 deletions
diff --git a/Lib/distutils/tests/test_sdist.py b/Lib/distutils/tests/test_sdist.py
index b7e5859..f95035d 100644
--- a/Lib/distutils/tests/test_sdist.py
+++ b/Lib/distutils/tests/test_sdist.py
@@ -277,6 +277,47 @@ class SDistTestCase(PyPIRCCommandTestCase):
self.assertRaises(DistutilsOptionError, cmd.finalize_options)
+ def test_get_file_list(self):
+ # make sure MANIFEST is recalculated
+ dist, cmd = self.get_cmd()
+
+ # filling data_files by pointing files in package_data
+ dist.package_data = {'somecode': ['*.txt']}
+ self.write_file((self.tmp_dir, 'somecode', 'doc.txt'), '#')
+ cmd.ensure_finalized()
+ cmd.run()
+
+ f = open(cmd.manifest)
+ try:
+ manifest = [line.strip() for line in f.read().split('\n')
+ if line.strip() != '']
+ finally:
+ f.close()
+
+ self.assertEquals(len(manifest), 4)
+
+ # adding a file
+ self.write_file((self.tmp_dir, 'somecode', 'doc2.txt'), '#')
+
+ # make sure build_py is reinitinialized, like a fresh run
+ build_py = dist.get_command_obj('build_py')
+ build_py.finalized = False
+ build_py.ensure_finalized()
+
+ cmd.run()
+
+ f = open(cmd.manifest)
+ try:
+ manifest2 = [line.strip() for line in f.read().split('\n')
+ if line.strip() != '']
+ finally:
+ f.close()
+
+ # do we have the new file in MANIFEST ?
+ self.assertEquals(len(manifest2), 5)
+ self.assertIn('doc2.txt', manifest2[-1])
+
+
def test_suite():
return unittest.makeSuite(SDistTestCase)