Example #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)
Example #2
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)
Example #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')
Example #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')