+
+
+
+
+
+
+
+
+
+
+
+
+
+
+"""
+
+# A manifest with references to assemblies other than msvcrt. When processed,
+# this assembly should be returned with just the msvcrt part removed.
+_MANIFEST_WITH_MULTIPLE_REFERENCES = """\
@@ -115,7 +144,7 @@
manifest = os.path.join(tempdir, 'manifest')
f = open(manifest, 'w')
try:
- f.write(_MANIFEST)
+ f.write(_MANIFEST_WITH_MULTIPLE_REFERENCES)
finally:
f.close()
@@ -133,6 +162,20 @@
# makes sure the manifest was properly cleaned
self.assertEqual(content, _CLEANED_MANIFEST)
+ def test_remove_entire_manifest(self):
+ from distutils.msvc9compiler import MSVCCompiler
+ tempdir = self.mkdtemp()
+ manifest = os.path.join(tempdir, 'manifest')
+ f = open(manifest, 'w')
+ try:
+ f.write(_MANIFEST_WITH_ONLY_MSVC_REFERENCE)
+ finally:
+ f.close()
+
+ compiler = MSVCCompiler()
+ got = compiler._remove_visual_c_ref(manifest)
+ self.assertIs(got, None)
+
def test_suite():
return unittest.makeSuite(msvc9compilerTestCase)