Checking renaming a node to an existing name.
(self)
| 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""" |
nothing calls this directly
no test coverage detected