'test the channel method'

def test_channel(self):

    self.connection._next_channel_number = mock.Mock(return_value=42)
    test_channel = mock.Mock(spec=channel.Channel)
    self.connection._create_channel = mock.Mock(return_value=test_channel)
    self.connection._add_channel_callbacks = mock.Mock()
    ret_channel = self.connection.channel(callback_method)
    self.assertEqual(test_channel, ret_channel)
    self.connection._create_channel.assert_called_once_with(42, callback_method)
    self.connection._add_channel_callbacks.assert_called_once_with(42)
    test_channel.open.assert_called_once_with()
