(self)
| 60 | self.transfer_future = TransferFuture(self.transfer_meta) |
| 61 | |
| 62 | def test_get_callbacks(self): |
| 63 | callbacks = get_callbacks(self.transfer_future, 'queued') |
| 64 | # Make sure two callbacks were added as both subscribers had |
| 65 | # an on_queued method. |
| 66 | self.assertEqual(len(callbacks), 2) |
| 67 | |
| 68 | # Ensure that the callback was injected with the future by calling |
| 69 | # one of them and checking that the future was used in the call. |
| 70 | callbacks[0]() |
| 71 | self.assertEqual( |
| 72 | self.subscriber.on_queued_calls, [{'future': self.transfer_future}] |
| 73 | ) |
| 74 | |
| 75 | def test_get_callbacks_for_missing_type(self): |
| 76 | callbacks = get_callbacks(self.transfer_future, 'fake_state') |
nothing calls this directly
no test coverage detected