def test_move_node(self):
        """Test move_node method."""
        root_id = self.vgw.get_root().id
        dira1 = self.vgw.make_subdirectory(root_id, 'dira1')
        dira2 = self.vgw.make_subdirectory(dira1.id, 'dira2')
        dira3 = self.vgw.make_subdirectory(dira2.id, 'dira3')
        dira4 = self.vgw.make_subdirectory(dira3.id, 'dira4')
        dira5 = self.vgw.make_subdirectory(dira4.id, 'dira5')
        dira6 = self.vgw.make_subdirectory(dira5.id, 'dira6')
        dirb1 = self.vgw.make_subdirectory(root_id, 'dirb1')
        dirb2 = self.vgw.make_subdirectory(dirb1.id, 'dirb2')
        dirb3 = self.vgw.make_subdirectory(dirb2.id, 'dirb3')
        dirb4 = self.vgw.make_subdirectory(dirb3.id, 'dirb4')
        dirb5 = self.vgw.make_subdirectory(dirb4.id, 'dirb5')
        self.vgw.make_subdirectory(dirb5.id, 'dirb6')
        self.assertRaises(errors.DoesNotExist,
                          self.vgw.move_node, uuid.uuid4(), dira2.id, 'name')
        self.assertRaises(errors.DoesNotExist,
                          self.vgw.move_node, dira1.id, uuid.uuid4(), 'name')
        self.assertRaises(errors.NoPermission,
                          self.vgw.move_node, dira1.id, dira2.id, 'name')
        dira1 = self.vgw.move_node(dira1.id, dirb1.id, 'newname')
        self.assertEqual(dira1.parent_id, dirb1.id)
        self.assertEqual(dira1.name, 'newname')
        dira6 = self.vgw.get_node(dira6.id)
        path = posixpath.join(
            self.vgw.get_root().full_path,
            'dirb1/newname/dira2/dira3/dira4/dira5')
        self.assertEqual(dira6.path, path)
        dirb2 = self.vgw.get_node(dirb2.id)
        # make sure moving with the same name deletes old node and descendants
        dirb4 = self.vgw.move_node(dirb4.id, dirb2.id, 'dirb3')
        self.assertEqual(dirb4.parent_id, dirb2.id)
        self.assertRaises(errors.DoesNotExist, self.vgw.get_node, dirb3.id)
        self.assertRaises(errors.DoesNotExist, self.vgw.get_node, dirb4.id)
        self.assertRaises(errors.DoesNotExist, self.vgw.get_node, dirb5.id)