Exemplo n.º 1
0
 def test_remove_if_present(self):
     tmpdir = test_utils.mkdtemp()
     filename = os.path.join(tmpdir, 'afile')
     with open(filename, 'wb') as f:
         f.write(b'dontcare')
     # File exists
     self.assertTrue(os.path.exists(filename))
     python_archive.remove_if_present(filename)
     self.assertFalse(os.path.exists(filename))
     # File doesn't exist
     python_archive.remove_if_present(filename)
     self.assertFalse(os.path.exists(filename))
Exemplo n.º 2
0
 def test_remove_if_present(self):
     tmpdir = test_utils.mkdtemp()
     filename = os.path.join(tmpdir, 'afile')
     with open(filename, 'wb') as f:
         f.write(b'dontcare')
     # File exists
     self.assertTrue(os.path.exists(filename))
     python_archive.remove_if_present(filename)
     self.assertFalse(os.path.exists(filename))
     # File doesn't exist
     python_archive.remove_if_present(filename)
     self.assertFalse(os.path.exists(filename))