Checking non-recursive copy of a Group
(self)
| 826 | super().tearDown() |
| 827 | |
| 828 | def test00_nonRecursive(self): |
| 829 | """Checking non-recursive copy of a Group""" |
| 830 | |
| 831 | if common.verbose: |
| 832 | print("\n", "-=" * 30) |
| 833 | print( |
| 834 | "Running %s.test00_nonRecursive..." % self.__class__.__name__ |
| 835 | ) |
| 836 | |
| 837 | # Copy a group non-recursively |
| 838 | srcgroup = self.h5file.root.group0.group1 |
| 839 | # srcgroup._f_copy_children(self.h5file2.root, recursive=False, |
| 840 | # filters=self.filters) |
| 841 | self.h5file.copy_children( |
| 842 | srcgroup, self.h5file2.root, recursive=False, filters=self.filters |
| 843 | ) |
| 844 | if self.close: |
| 845 | # Close the destination file |
| 846 | self.h5file2.close() |
| 847 | # And open it again |
| 848 | self.h5file2 = tb.open_file(self.h5fname2, "r") |
| 849 | |
| 850 | # Check that the copy has been done correctly |
| 851 | dstgroup = self.h5file2.root |
| 852 | nodelist1 = list(srcgroup._v_children) |
| 853 | nodelist2 = list(dstgroup._v_children) |
| 854 | # Sort the lists |
| 855 | nodelist1.sort() |
| 856 | nodelist2.sort() |
| 857 | if common.verbose: |
| 858 | print("The origin node list -->", nodelist1) |
| 859 | print("The copied node list -->", nodelist2) |
| 860 | self.assertEqual(srcgroup._v_nchildren, dstgroup._v_nchildren) |
| 861 | self.assertEqual(nodelist1, nodelist2) |
| 862 | |
| 863 | def test01_nonRecursiveAttrs(self): |
| 864 | """Checking non-recursive copy of a Group (attributes copied)""" |
nothing calls this directly
no test coverage detected