Copying the children of a group
(self)
| 2185 | self.assertIs(self.h5file.root.agroup, new_node) |
| 2186 | |
| 2187 | def test03_copyChildren(self): |
| 2188 | """Copying the children of a group""" |
| 2189 | |
| 2190 | if common.verbose: |
| 2191 | print("\n", "-=" * 30) |
| 2192 | print( |
| 2193 | "Running %s.test03_copyChildren..." % self.__class__.__name__ |
| 2194 | ) |
| 2195 | |
| 2196 | # Enable undo/redo. |
| 2197 | self.h5file.enable_undo() |
| 2198 | |
| 2199 | # /agroup/* => /agroup/ |
| 2200 | self.h5file.copy_children("/agroup", "/agroup2", recursive=True) |
| 2201 | |
| 2202 | # Undo the copy. |
| 2203 | self.h5file.undo() |
| 2204 | |
| 2205 | # Check that the copied nodes do not exist in the object tree. |
| 2206 | self.assertNotIn("/agroup2/anarray1", self.h5file) |
| 2207 | self.assertNotIn("/agroup2/anarray2", self.h5file) |
| 2208 | self.assertNotIn("/agroup2/agroup3", self.h5file) |
| 2209 | |
| 2210 | # Redo the copy. |
| 2211 | self.h5file.redo() |
| 2212 | |
| 2213 | # Check that the copied nodes exist again in the object tree. |
| 2214 | self.assertIn("/agroup2/anarray1", self.h5file) |
| 2215 | self.assertIn("/agroup2/anarray2", self.h5file) |
| 2216 | self.assertIn("/agroup2/agroup3", self.h5file) |
| 2217 | |
| 2218 | |
| 2219 | class ComplexTestCase(common.TempFileMixin, common.PyTablesTestCase): |
nothing calls this directly
no test coverage detected