(self)
| 61 | self.check_getitem_with_type(tp) |
| 62 | |
| 63 | def test_index(self): |
| 64 | for tp in self._types: |
| 65 | b = tp(self._source) |
| 66 | m = self._view(b) # may be a sub-view |
| 67 | l = m.tolist() |
| 68 | k = 2 * len(self._source) |
| 69 | |
| 70 | for chi in self._source: |
| 71 | if chi in l: |
| 72 | self.assertEqual(m.index(chi), l.index(chi)) |
| 73 | else: |
| 74 | self.assertRaises(ValueError, m.index, chi) |
| 75 | |
| 76 | for start, stop in product(range(-k, k), range(-k, k)): |
| 77 | index = -1 |
| 78 | try: |
| 79 | index = l.index(chi, start, stop) |
| 80 | except ValueError: |
| 81 | pass |
| 82 | |
| 83 | if index == -1: |
| 84 | self.assertRaises(ValueError, m.index, chi, start, stop) |
| 85 | else: |
| 86 | self.assertEqual(m.index(chi, start, stop), index) |
| 87 | |
| 88 | def test_iter(self): |
| 89 | for tp in self._types: |
nothing calls this directly
no test coverage detected