(self)
| 271 | self.assertCallStack([("__rxor__", (testme, 1))]) |
| 272 | |
| 273 | def testListAndDictOps(self): |
| 274 | testme = AllTests() |
| 275 | |
| 276 | # List/dict operations |
| 277 | |
| 278 | class Empty: pass |
| 279 | |
| 280 | try: |
| 281 | 1 in Empty() |
| 282 | self.fail('failed, should have raised TypeError') |
| 283 | except TypeError: |
| 284 | pass |
| 285 | |
| 286 | callLst[:] = [] |
| 287 | 1 in testme |
| 288 | self.assertCallStack([('__contains__', (testme, 1))]) |
| 289 | |
| 290 | callLst[:] = [] |
| 291 | testme[1] |
| 292 | self.assertCallStack([('__getitem__', (testme, 1))]) |
| 293 | |
| 294 | callLst[:] = [] |
| 295 | testme[1] = 1 |
| 296 | self.assertCallStack([('__setitem__', (testme, 1, 1))]) |
| 297 | |
| 298 | callLst[:] = [] |
| 299 | del testme[1] |
| 300 | self.assertCallStack([('__delitem__', (testme, 1))]) |
| 301 | |
| 302 | callLst[:] = [] |
| 303 | testme[:42] |
| 304 | self.assertCallStack([('__getitem__', (testme, slice(None, 42)))]) |
| 305 | |
| 306 | callLst[:] = [] |
| 307 | testme[:42] = "The Answer" |
| 308 | self.assertCallStack([('__setitem__', (testme, slice(None, 42), |
| 309 | "The Answer"))]) |
| 310 | |
| 311 | callLst[:] = [] |
| 312 | del testme[:42] |
| 313 | self.assertCallStack([('__delitem__', (testme, slice(None, 42)))]) |
| 314 | |
| 315 | callLst[:] = [] |
| 316 | testme[2:1024:10] |
| 317 | self.assertCallStack([('__getitem__', (testme, slice(2, 1024, 10)))]) |
| 318 | |
| 319 | callLst[:] = [] |
| 320 | testme[2:1024:10] = "A lot" |
| 321 | self.assertCallStack([('__setitem__', (testme, slice(2, 1024, 10), |
| 322 | "A lot"))]) |
| 323 | callLst[:] = [] |
| 324 | del testme[2:1024:10] |
| 325 | self.assertCallStack([('__delitem__', (testme, slice(2, 1024, 10)))]) |
| 326 | |
| 327 | callLst[:] = [] |
| 328 | testme[:42, ..., :24:, 24, 100] |
| 329 | self.assertCallStack([('__getitem__', (testme, (slice(None, 42, None), |
| 330 | Ellipsis, |
nothing calls this directly
no test coverage detected