def test_channel0_is_blocked(self): channel = Channel0(self.connection) self.assertFalse(channel.is_blocked) channel.on_frame(Connection.Blocked('travis-ci')) self.assertTrue(channel.is_blocked) self.assertEqual(self.get_last_log(), 'Connection is blocked by remote server: travis-ci')
def test_channel0_is_blocked(self): connection = amqpstorm.Connection('localhost', 'guest', 'guest', lazy=True) channel = Channel0(connection) self.assertFalse(channel.is_blocked) channel.on_frame(Connection.Blocked('unit-test')) self.assertTrue(channel.is_blocked) self.assertEqual(self.logging_handler.messages['warning'][0], 'Connection is blocked by remote server: unit-test')
def test_channel0_unblocked(self): connection = amqpstorm.Connection('localhost', 'guest', 'guest', lazy=True) channel = Channel0(connection) channel.on_frame(Connection.Blocked()) self.assertTrue(channel.is_blocked) channel.on_frame(Connection.Unblocked()) self.assertFalse(channel.is_blocked) self.assertEqual(self.logging_handler.messages['info'][0], 'Connection is no longer blocked by remote server')