(self)
| 142 | assert_equal(test, ()) |
| 143 | |
| 144 | def test_get_fieldstructure(self): |
| 145 | # Test get_fieldstructure |
| 146 | |
| 147 | # No nested fields |
| 148 | ndtype = np.dtype([('A', '|S3'), ('B', float)]) |
| 149 | test = get_fieldstructure(ndtype) |
| 150 | assert_equal(test, {'A': [], 'B': []}) |
| 151 | |
| 152 | # One 1-nested field |
| 153 | ndtype = np.dtype([('A', int), ('B', [('BA', float), ('BB', '|S1')])]) |
| 154 | test = get_fieldstructure(ndtype) |
| 155 | assert_equal(test, {'A': [], 'B': [], 'BA': ['B', ], 'BB': ['B']}) |
| 156 | |
| 157 | # One 2-nested fields |
| 158 | ndtype = np.dtype([('A', int), |
| 159 | ('B', [('BA', int), |
| 160 | ('BB', [('BBA', int), ('BBB', int)])])]) |
| 161 | test = get_fieldstructure(ndtype) |
| 162 | control = {'A': [], 'B': [], 'BA': ['B'], 'BB': ['B'], |
| 163 | 'BBA': ['B', 'BB'], 'BBB': ['B', 'BB']} |
| 164 | assert_equal(test, control) |
| 165 | |
| 166 | # 0 fields |
| 167 | ndtype = np.dtype([]) |
| 168 | test = get_fieldstructure(ndtype) |
| 169 | assert_equal(test, {}) |
| 170 | |
| 171 | def test_find_duplicates(self): |
| 172 | # Test find_duplicates |
nothing calls this directly
no test coverage detected