summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/tests/test_sdist.py
diff options
context:
space:
mode:
authorÉric Araujo <merwok@netwok.org>2010-08-14 02:36:26 (GMT)
committerÉric Araujo <merwok@netwok.org>2010-08-14 02:36:26 (GMT)
commit60a95b78b96a7669acc3bdf3d873db07018ea209 (patch)
treeae73181fd92e333713da7b7c23c993cdd40a1948 /Lib/distutils/tests/test_sdist.py
parentf263c0594c9277d80a8ab23a72393f3c2a33d23f (diff)
downloadcpython-60a95b78b96a7669acc3bdf3d873db07018ea209.zip
cpython-60a95b78b96a7669acc3bdf3d873db07018ea209.tar.gz
cpython-60a95b78b96a7669acc3bdf3d873db07018ea209.tar.bz2
Merged revisions 83993 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r83993 | eric.araujo | 2010-08-14 04:30:34 +0200 (sam., 14 août 2010) | 2 lines Use a marker in generated MANIFEST files, don't touch files without it. Fixes #8688. ........
Diffstat (limited to 'Lib/distutils/tests/test_sdist.py')
-rw-r--r--Lib/distutils/tests/test_sdist.py36
1 files changed, 34 insertions, 2 deletions
diff --git a/Lib/distutils/tests/test_sdist.py b/Lib/distutils/tests/test_sdist.py
index f95035d..209aa59 100644
--- a/Lib/distutils/tests/test_sdist.py
+++ b/Lib/distutils/tests/test_sdist.py
@@ -29,6 +29,7 @@ setup(name='fake')
"""
MANIFEST = """\
+# file GENERATED by distutils, do NOT edit
README
inroot.txt
setup.py
@@ -294,7 +295,7 @@ class SDistTestCase(PyPIRCCommandTestCase):
finally:
f.close()
- self.assertEquals(len(manifest), 4)
+ self.assertEquals(len(manifest), 5)
# adding a file
self.write_file((self.tmp_dir, 'somecode', 'doc2.txt'), '#')
@@ -314,9 +315,40 @@ class SDistTestCase(PyPIRCCommandTestCase):
f.close()
# do we have the new file in MANIFEST ?
- self.assertEquals(len(manifest2), 5)
+ self.assertEquals(len(manifest2), 6)
self.assertIn('doc2.txt', manifest2[-1])
+ def test_manifest_marker(self):
+ # check that autogenerated MANIFESTs have a marker
+ dist, cmd = self.get_cmd()
+ 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.assertEqual(manifest[0],
+ '# file GENERATED by distutils, do NOT edit')
+
+ def test_manual_manifest(self):
+ # check that a MANIFEST without a marker is left alone
+ dist, cmd = self.get_cmd()
+ cmd.ensure_finalized()
+ self.write_file((self.tmp_dir, cmd.manifest), 'README.manual')
+ cmd.run()
+
+ f = open(cmd.manifest)
+ try:
+ manifest = [line.strip() for line in f.read().split('\n')
+ if line.strip() != '']
+ finally:
+ f.close()
+
+ self.assertEqual(manifest, ['README.manual'])
def test_suite():
return unittest.makeSuite(SDistTestCase)