MCPcopy Create free account
hub / github.com/PyTables/PyTables / test09b_renameGroup

Method test09b_renameGroup

tables/tests/test_basics.py:512–535  ·  view source on GitHub ↗

Checking renaming a Group and access it immediately.

(self)

Source from the content-addressed store, hash-verified

510 self.h5file.get_node("/agroup/agroup3")
511
512 def test09b_renameGroup(self):
513 """Checking renaming a Group and access it immediately."""
514
515 self._reopen(mode="r+", node_cache_slots=self.node_cache_slots)
516 self.h5file.rename_node(self.h5file.root.agroup, "agroup3")
517
518 # Ensure that the new name exists
519 group = self.h5file.root.agroup3
520 self.assertEqual(group._v_name, "agroup3")
521 self.assertEqual(group._v_pathname, "/agroup3")
522
523 # The children of this group also must be accessible through the
524 # new name path
525 group2 = self.h5file.get_node("/agroup3/agroup3")
526 self.assertEqual(group2._v_name, "agroup3")
527 self.assertEqual(group2._v_pathname, "/agroup3/agroup3")
528
529 # Try to get the previous object with the old name
530 with self.assertRaises(LookupError):
531 self.h5file.root.agroup
532
533 # Try to get a child with the old pathname
534 with self.assertRaises(LookupError):
535 self.h5file.get_node("/agroup/agroup3")
536
537 def test09c_renameGroup(self):
538 """Checking renaming a Group and modify attributes afterwards."""

Callers

nothing calls this directly

Calls 3

_reopenMethod · 0.45
rename_nodeMethod · 0.45
get_nodeMethod · 0.45

Tested by

no test coverage detected