Ejemplo n.º 1
0
 def test_not_delete_on_failure(self):
     _touch(self.path)
     try:
         with TempFile(self.path, delete_on_error=False):
             raise Exception()
     except:
         pass
     self.assertTrue(os.path.exists(self.path))
Ejemplo n.º 2
0
 def test_not_delete_on_success(self):
     _touch(self.path)
     with TempFile(self.path, delete_on_success=False):
         pass
     self.assertTrue(os.path.exists(self.path))
Ejemplo n.º 3
0
 def test_already_deleted(self):
     _touch(self.path)
     with TempFile(self.path):
         os.remove(self.path)
     self.assertFalse(os.path.exists(self.path))
Ejemplo n.º 4
0
 def test_not_deleted(self):
     _touch(self.path)
     with TempFile(self.path):
         pass
     self.assertFalse(os.path.exists(self.path))
Ejemplo n.º 5
0
 def test_never_created(self):
     with TempFile(self.path):
         pass
     self.assertFalse(os.path.exists(self.path))