MCPcopy Create free account
hub / github.com/aws/aws-cli / test_get_callbacks

Method test_get_callbacks

tests/unit/s3transfer/test_utils.py:62–73  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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')

Callers

nothing calls this directly

Calls 1

get_callbacksFunction · 0.90

Tested by

no test coverage detected