Checking moving a Group and access it after a close/open.
(self)
| 743 | self.assertIs(srcNode, dstNode) |
| 744 | |
| 745 | def test11_moveGroup(self): |
| 746 | """Checking moving a Group and access it after a close/open.""" |
| 747 | |
| 748 | self._reopen(mode="r+", node_cache_slots=self.node_cache_slots) |
| 749 | newgroup = self.h5file.create_group(self.h5file.root, "newgroup") |
| 750 | self.h5file.move_node(self.h5file.root.agroup, newgroup, "agroup3") |
| 751 | |
| 752 | # Open this file in read-only mode |
| 753 | self._reopen(node_cache_slots=self.node_cache_slots) |
| 754 | |
| 755 | # Ensure that the new name exists |
| 756 | group = self.h5file.root.newgroup.agroup3 |
| 757 | self.assertEqual(group._v_name, "agroup3") |
| 758 | self.assertEqual(group._v_pathname, "/newgroup/agroup3") |
| 759 | self.assertEqual(group._v_depth, 2) |
| 760 | |
| 761 | # The children of this group must also be accessible through the |
| 762 | # new name path |
| 763 | group2 = self.h5file.get_node("/newgroup/agroup3/agroup3") |
| 764 | self.assertEqual(group2._v_name, "agroup3") |
| 765 | self.assertEqual(group2._v_pathname, "/newgroup/agroup3/agroup3") |
| 766 | self.assertEqual(group2._v_depth, 3) |
| 767 | |
| 768 | # Try to get the previous object with the old name |
| 769 | with self.assertRaises(LookupError): |
| 770 | self.h5file.root.agroup |
| 771 | |
| 772 | # Try to get a child with the old pathname |
| 773 | with self.assertRaises(LookupError): |
| 774 | self.h5file.get_node("/agroup/agroup3") |
| 775 | |
| 776 | def test11b_moveGroup(self): |
| 777 | """Checking moving a Group and access it immediately.""" |
nothing calls this directly
no test coverage detected