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