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

Method test09e_renameGroup

tables/tests/test_basics.py:559–582  ·  view source on GitHub ↗

Checking renaming a Group with nested groups in the LRU cache.

(self)

Source from the content-addressed store, hash-verified

557 self.assertEqual(group._v_title, "Group title 3")
558
559 def test09e_renameGroup(self):
560 """Checking renaming a Group with nested groups in the LRU cache."""
561 # This checks for ticket #126.
562
563 self._reopen(mode="r+", node_cache_slots=self.node_cache_slots)
564
565 # Load intermediate groups and keep a nested one alive.
566 g = self.h5file.root.agroup.agroup3.agroup4
567 self.assertIsNotNone(g)
568 self.h5file.rename_node("/", name="agroup", newname="agroup_")
569
570 # see ticket #126
571 self.assertNotIn("/agroup_/agroup4", self.h5file)
572
573 self.assertNotIn("/agroup", self.h5file)
574 for newpath in [
575 "/agroup_",
576 "/agroup_/agroup3",
577 "/agroup_/agroup3/agroup4",
578 ]:
579 self.assertIn(newpath, self.h5file)
580 self.assertEqual(
581 newpath, self.h5file.get_node(newpath)._v_pathname
582 )
583
584 def test10_moveLeaf(self):
585 """Checking moving a leave and access it after a close/open."""

Callers

nothing calls this directly

Calls 3

_reopenMethod · 0.45
rename_nodeMethod · 0.45
get_nodeMethod · 0.45

Tested by

no test coverage detected