'make sure the callback adding works'

def test_add_callbacks(self):

    self.connection.callbacks = mock.Mock(spec=self.connection.callbacks)
    for (test_method, expected_key) in ((self.connection.add_backpressure_callback, self.connection.ON_CONNECTION_BACKPRESSURE), (self.connection.add_on_open_callback, self.connection.ON_CONNECTION_OPEN), (self.connection.add_on_close_callback, self.connection.ON_CONNECTION_CLOSED)):
        self.connection.callbacks.reset_mock()
        test_method(callback_method)
        self.connection.callbacks.add.assert_called_once_with(0, expected_key, callback_method, False)
