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

Method test07_renameLeaf

tables/tests/test_basics.py:400–417  ·  view source on GitHub ↗

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

(self)

Source from the content-addressed store, hash-verified

398 self.h5file.root.atable
399
400 def test07_renameLeaf(self):
401 """Checking renaming a leave and access it after a close/open."""
402
403 self._reopen(mode="r+", node_cache_slots=self.node_cache_slots)
404 self.h5file.rename_node(self.h5file.root.anarray, "anarray2")
405
406 # Open this file in read-only mode
407 self._reopen(node_cache_slots=self.node_cache_slots)
408
409 # Ensure that the new name exists
410 array_ = self.h5file.root.anarray2
411 self.assertEqual(array_.name, "anarray2")
412 self.assertEqual(array_._v_pathname, "/anarray2")
413 self.assertEqual(array_._v_depth, 1)
414
415 # Try to get the previous object with the old name
416 with self.assertRaises(LookupError):
417 self.h5file.root.anarray
418
419 def test07b_renameLeaf(self):
420 """Checking renaming Leaves and accesing them immediately."""

Callers

nothing calls this directly

Calls 2

_reopenMethod · 0.45
rename_nodeMethod · 0.45

Tested by

no test coverage detected