def test_move(self): try: fo = FileObject("test", temporary=True) fo.move("test_move") if not os.path.exists("test_move"): raise Exception("Failed to move") except Exception as exc: traceback.print_exc() self.fail(exc)
def test_move_chmod(self): try: fo = FileObject("test", temporary=True) fo.move("test_move") fo.chmod(0o644) if oct(os.stat(fo.path).st_mode & 0o777) != oct(0o644): raise Exception("Wrong mode of moved file") except Exception as exc: traceback.print_exc() self.fail(exc)