| 339 | event.listen(t1, "event_one", Mock()) |
| 340 | |
| 341 | def test_slots_dispatch(self): |
| 342 | class Target: |
| 343 | __slots__ = ("_slots_dispatch",) |
| 344 | |
| 345 | class TargetEvents(event.Events): |
| 346 | _dispatch_target = Target |
| 347 | |
| 348 | def event_one(self, x, y): |
| 349 | pass |
| 350 | |
| 351 | def event_two(self, x): |
| 352 | pass |
| 353 | |
| 354 | def event_three(self, x): |
| 355 | pass |
| 356 | |
| 357 | t1 = Target() |
| 358 | |
| 359 | m1 = Mock() |
| 360 | event.listen(t1, "event_one", m1) |
| 361 | |
| 362 | t1.dispatch.event_one(2, 4) |
| 363 | |
| 364 | eq_(m1.mock_calls, [call(2, 4)]) |
| 365 | |
| 366 | |
| 367 | class NamedCallTest(TearDownLocalEventsFixture, fixtures.TestBase): |