Checking renaming a Group and access it after a close/open.
(self)
| 482 | self.h5file.rename_node(self.h5file.root.anarray, "array 2") |
| 483 | |
| 484 | def test09_renameGroup(self): |
| 485 | """Checking renaming a Group and access it after a close/open.""" |
| 486 | |
| 487 | self._reopen(mode="r+", node_cache_slots=self.node_cache_slots) |
| 488 | self.h5file.rename_node(self.h5file.root.agroup, "agroup3") |
| 489 | |
| 490 | # Open this file in read-only mode |
| 491 | self._reopen(node_cache_slots=self.node_cache_slots) |
| 492 | |
| 493 | # Ensure that the new name exists |
| 494 | group = self.h5file.root.agroup3 |
| 495 | self.assertEqual(group._v_name, "agroup3") |
| 496 | self.assertEqual(group._v_pathname, "/agroup3") |
| 497 | |
| 498 | # The children of this group also must be accessible through the |
| 499 | # new name path |
| 500 | group2 = self.h5file.get_node("/agroup3/agroup3") |
| 501 | self.assertEqual(group2._v_name, "agroup3") |
| 502 | self.assertEqual(group2._v_pathname, "/agroup3/agroup3") |
| 503 | |
| 504 | # Try to get the previous object with the old name |
| 505 | with self.assertRaises(LookupError): |
| 506 | self.h5file.root.agroup |
| 507 | |
| 508 | # Try to get a child with the old pathname |
| 509 | with self.assertRaises(LookupError): |
| 510 | self.h5file.get_node("/agroup/agroup3") |
| 511 | |
| 512 | def test09b_renameGroup(self): |
| 513 | """Checking renaming a Group and access it immediately.""" |
nothing calls this directly
no test coverage detected