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

Method test10b_moveLeaf

tables/tests/test_basics.py:604–619  ·  view source on GitHub ↗

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

(self)

Source from the content-addressed store, hash-verified

602 self.h5file.root.anarray
603
604 def test10b_moveLeaf(self):
605 """Checking moving a leave and access it without a close/open."""
606
607 self._reopen(mode="r+", node_cache_slots=self.node_cache_slots)
608 newgroup = self.h5file.create_group("/", "newgroup")
609 self.h5file.move_node(self.h5file.root.anarray, newgroup, "anarray2")
610
611 # Ensure that the new name exists
612 array_ = self.h5file.root.newgroup.anarray2
613 self.assertEqual(array_.name, "anarray2")
614 self.assertEqual(array_._v_pathname, "/newgroup/anarray2")
615 self.assertEqual(array_._v_depth, 2)
616
617 # Try to get the previous object with the old name
618 with self.assertRaises(LookupError):
619 self.h5file.root.anarray
620
621 def test10c_moveLeaf(self):
622 """Checking moving Leaves and modify attributes after that."""

Callers

nothing calls this directly

Calls 3

create_groupMethod · 0.80
move_nodeMethod · 0.80
_reopenMethod · 0.45

Tested by

no test coverage detected