'Test the pass through function of Session.create_channel to the ChannelManager.'

def test_create_channel(self):

    class LmMock(object, ):
        class ChannelManager(object, ):
            invoked_name = None
            invoked_desc = None
            invoked_mode = None
            def create_channel(self, name, description, mode=u'closed'):
                self.invoked_name = name
                self.invoked_desc = description
                self.invoked_mode = mode
        channel_manager = ChannelManager()
    config = TriblerConfig()
    config.set_state_dir(self.getStateDir())
    session = Session(config, ignore_singleton=True)
    session.lm = LmMock()
    session.lm.api_manager = None
    session.create_channel('name', 'description', 'open')
    self.assertEqual(session.lm.channel_manager.invoked_name, 'name')
    self.assertEqual(session.lm.channel_manager.invoked_desc, 'description')
    self.assertEqual(session.lm.channel_manager.invoked_mode, 'open')
