MCPcopy Index your code
hub / github.com/PyTables/PyTables / test10_2_moveTable

Method test10_2_moveTable

tables/tests/test_basics.py:645–663  ·  view source on GitHub ↗

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

(self)

Source from the content-addressed store, hash-verified

643 )
644
645 def test10_2_moveTable(self):
646 """Checking moving a table and access it after a close/open."""
647
648 self._reopen(mode="r+", node_cache_slots=self.node_cache_slots)
649 newgroup = self.h5file.create_group("/", "newgroup")
650 self.h5file.move_node(self.h5file.root.atable, newgroup, "atable2")
651
652 # Open this file in read-only mode
653 self._reopen(node_cache_slots=self.node_cache_slots)
654
655 # Ensure that the new name exists
656 table_ = self.h5file.root.newgroup.atable2
657 self.assertEqual(table_.name, "atable2")
658 self.assertEqual(table_._v_pathname, "/newgroup/atable2")
659 self.assertEqual(table_._v_depth, 2)
660
661 # Try to get the previous object with the old name
662 with self.assertRaises(LookupError):
663 self.h5file.root.atable
664
665 def test10_2b_moveTable(self):
666 """Checking moving a table 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