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

Method test10_moveLeaf

tables/tests/test_basics.py:584–602  ·  view source on GitHub ↗

Checking moving a leave and access it after a close/open.

(self)

Source from the content-addressed store, hash-verified

582 )
583
584 def test10_moveLeaf(self):
585 """Checking moving a leave and access it after a close/open."""
586
587 self._reopen(mode="r+", node_cache_slots=self.node_cache_slots)
588 newgroup = self.h5file.create_group("/", "newgroup")
589 self.h5file.move_node(self.h5file.root.anarray, newgroup, "anarray2")
590
591 # Open this file in read-only mode
592 self._reopen(node_cache_slots=self.node_cache_slots)
593
594 # Ensure that the new name exists
595 array_ = self.h5file.root.newgroup.anarray2
596 self.assertEqual(array_.name, "anarray2")
597 self.assertEqual(array_._v_pathname, "/newgroup/anarray2")
598 self.assertEqual(array_._v_depth, 2)
599
600 # Try to get the previous object with the old name
601 with self.assertRaises(LookupError):
602 self.h5file.root.anarray
603
604 def test10b_moveLeaf(self):
605 """Checking moving a leave and access it without a close/open."""

Callers

nothing calls this directly

Calls 3

create_groupMethod · 0.80
move_nodeMethod · 0.80
_reopenMethod · 0.45

Tested by

no test coverage detected