def test_remove_visual_c_ref(self): from distutils.msvc9compiler import MSVCCompiler tempdir = self.mkdtemp() manifest = os.path.join(tempdir, 'manifest') f = open(manifest, 'w') try: f.write(_MANIFEST_WITH_MULTIPLE_REFERENCES) finally: f.close() compiler = MSVCCompiler() compiler._remove_visual_c_ref(manifest) f = open(manifest) try: content = '\n'.join([line.rstrip() for line in f.readlines()]) finally: f.close() self.assertEqual(content, _CLEANED_MANIFEST)
def test_remove_visual_c_ref(self): from distutils.msvc9compiler import MSVCCompiler tempdir = self.mkdtemp() manifest = os.path.join(tempdir, 'manifest') f = open(manifest, 'w') f.write(_MANIFEST) f.close() compiler = MSVCCompiler() compiler._remove_visual_c_ref(manifest) # see what we got f = open(manifest) # removing trailing spaces content = '\n'.join([line.rstrip() for line in f.readlines()]) f.close() # makes sure the manifest was properly cleaned self.assertEquals(content, _CLEANED_MANIFEST)
def test_remove_visual_c_ref(self): from distutils.msvc9compiler import MSVCCompiler tempdir = self.mkdtemp() manifest = os.path.join(tempdir, 'manifest') f = open(manifest, 'w') try: f.write(_MANIFEST_WITH_MULTIPLE_REFERENCES) finally: f.close() compiler = MSVCCompiler() compiler._remove_visual_c_ref(manifest) f = open(manifest) try: content = '\n'.join([ line.rstrip() for line in f.readlines() ]) finally: f.close() self.assertEqual(content, _CLEANED_MANIFEST)
def test_remove_visual_c_ref(self): from distutils.msvc9compiler import MSVCCompiler tempdir = self.mkdtemp() manifest = os.path.join(tempdir, 'manifest') f = open(manifest, 'w') f.write(_MANIFEST) f.close() compiler = MSVCCompiler() compiler._remove_visual_c_ref(manifest) # see what we got f = open(manifest) # removing trailing spaces content = '\n'.join([line.rstrip() for line in f.readlines()]) f.close() # makes sure the manifest was properly cleaned self.assertEquals(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.assertIsNone(got)
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_remove_visual_c_ref(self): from distutils.msvc9compiler import MSVCCompiler tempdir = self.mkdtemp() manifest = os.path.join(tempdir, "manifest") f = open(manifest, "w") try: f.write(_MANIFEST_WITH_MULTIPLE_REFERENCES) finally: f.close() compiler = MSVCCompiler() compiler._remove_visual_c_ref(manifest) # see what we got f = open(manifest) try: # removing trailing spaces content = "\n".join([line.rstrip() for line in f.readlines()]) finally: f.close() # makes sure the manifest was properly cleaned self.assertEqual(content, _CLEANED_MANIFEST)