'BlockingConnection register for Connection.Blocked/Unblocked'

def test(self):

    connection = self._connect()
    connection.add_on_connection_blocked_callback((lambda frame: None))
    blocked_buffer = []
    evt = blocking_connection._ConnectionBlockedEvt((lambda f: blocked_buffer.append('blocked')), pika.frame.Method(1, pika.spec.Connection.Blocked('reason')))
    repr(evt)
    evt.dispatch()
    self.assertEqual(blocked_buffer, ['blocked'])
    unblocked_buffer = []
    connection.add_on_connection_unblocked_callback((lambda frame: None))
    evt = blocking_connection._ConnectionUnblockedEvt((lambda f: unblocked_buffer.append('unblocked')), pika.frame.Method(1, pika.spec.Connection.Unblocked()))
    repr(evt)
    evt.dispatch()
    self.assertEqual(unblocked_buffer, ['unblocked'])
