'Setup some classes and files that are used by the tests in this module.'

@blocking_call_on_reactor_thread
@inlineCallbacks
def setUp(self, annotate=True, autoload_discovery=True):

    (yield super(BaseTestChannel, self).setUp(autoload_discovery=autoload_discovery))
    if annotate:
        self.annotate(self._testMethodName, start=True)
    self.fake_session = MockObject()
    self.fake_session.add_observer = (lambda a, b, c: False)
    self.fake_session_config = MockObject()
    self.fake_session_config.get_state_dir = (lambda : self.session_base_dir)
    self.fake_session.config = self.fake_session_config
    fake_notifier = MockObject()
    fake_notifier.add_observer = (lambda a, b, c, d: False)
    fake_notifier.notify = (lambda a, b, c, d: False)
    self.fake_session.notifier = fake_notifier
    self.fake_channel_community = MockObject()
    self.fake_channel_community.get_channel_id = (lambda : 42)
    self.fake_channel_community.cid = ('a' * 20)
    self.fake_channel_community.get_channel_name = (lambda : 'my    fancy    channel')
    self.channel_db_handler = self.session.open_dbhandler(NTFY_CHANNELCAST)
    self.votecast_db_handler = self.session.open_dbhandler(NTFY_VOTECAST)
    self.session.get_dispersy = (lambda : True)
    self.session.lm.dispersy = Dispersy(ManualEnpoint(0), self.getStateDir())
