def test01_copyGroup(self):
        """Copying a group (recursively)."""

        if common.verbose:
            print('\n', '-=' * 30)
            print("Running %s.test01_copyGroup..." % self.__class__.__name__)

        # Enable undo/redo.
        self.h5file.enable_undo()

        # /agroup => /acopy
        new_node = self.h5file.copy_node(
            '/agroup', newname='acopy', recursive=True)

        # Undo the copy.
        self.h5file.undo()

        # Check that the copied node does not exist in the object tree.
        self.assertTrue('/acopy' not in self.h5file)
        self.assertTrue('/acopy/anarray1' not in self.h5file)
        self.assertTrue('/acopy/anarray2' not in self.h5file)
        self.assertTrue('/acopy/agroup3' not in self.h5file)

        # Redo the copy.
        self.h5file.redo()

        # Check that the copied node exists again in the object tree.
        self.assertTrue('/acopy' in self.h5file)
        self.assertTrue('/acopy/anarray1' in self.h5file)
        self.assertTrue('/acopy/anarray2' in self.h5file)
        self.assertTrue('/acopy/agroup3' in self.h5file)
        self.assertTrue(self.h5file.root.acopy is new_node)
dataset/ETHPy150Open PyTables/PyTables/tables/tests/test_do_undo.py/CopyNodeTestCase.test01_copyGroup/original