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

Method test08_renameToExistingLeaf

tables/tests/test_basics.py:457–470  ·  view source on GitHub ↗

Checking renaming a node to an existing name.

(self)

Source from the content-addressed store, hash-verified

455 self.assertEqual(node._v_title, "Array title 2")
456
457 def test08_renameToExistingLeaf(self):
458 """Checking renaming a node to an existing name."""
459
460 self._reopen(mode="r+", node_cache_slots=self.node_cache_slots)
461
462 # Try to get the previous object with the old name
463 with self.assertRaises(tb.NodeError):
464 self.h5file.rename_node(self.h5file.root.anarray, "array")
465
466 # Now overwrite the destination node.
467 anarray = self.h5file.root.anarray
468 self.h5file.rename_node(anarray, "array", overwrite=True)
469 self.assertNotIn("/anarray", self.h5file)
470 self.assertIs(self.h5file.root.array, anarray)
471
472 def test08b_renameToNotValidNaturalName(self):
473 """Checking renaming a node to a non-valid natural name"""

Callers

nothing calls this directly

Calls 2

_reopenMethod · 0.45
rename_nodeMethod · 0.45

Tested by

no test coverage detected