示例#1
0
def restore_action(args: argparse.Namespace) -> int:
    try:
        r = trash.restore(args.node)
    except RequestError as e:
        logger.error('Error restoring "%s"' % args.node, e)
        return 1
    sync.insert_node(r)
示例#2
0
文件: acd_cli.py 项目: nabcos/acd_cli
def restore_action(args: argparse.Namespace) -> int:
    try:
        r = trash.restore(args.node)
    except RequestError as e:
        logger.error('Error restoring "%s"' % args.node, e)
        return 1
    sync.insert_node(r)
示例#3
0
 def test_restore(self):
     f_id = self.create_random_dir()
     n = trash.move_to_trash(f_id)
     self.assertEqual(n['status'], 'TRASH')
     n = trash.restore(n['id'])
     self.assertEqual(n['status'], 'AVAILABLE')
     n = trash.move_to_trash(n['id'])
     self.assertEqual(n['status'], 'TRASH')
示例#4
0
 def test_restore(self):
     f_id = self.create_random_dir()
     n = trash.move_to_trash(f_id)
     self.assertEqual(n['status'], 'TRASH')
     n = trash.restore(n['id'])
     self.assertEqual(n['status'], 'AVAILABLE')
     n = trash.move_to_trash(n['id'])
     self.assertEqual(n['status'], 'TRASH')