'Tests that the include/exclude logic works'

def test_channel_filters(self):

    worker = Worker(None, only_channels=[u'yes.*', u'maybe.*'])
    self.assertEqual(worker.apply_channel_filters([u'yes.1', u'no.1']), [u'yes.1'])
    self.assertEqual(worker.apply_channel_filters([u'yes.1', u'no.1', u'maybe.2', u'yes']), [u'yes.1', u'maybe.2'])
    worker = Worker(None, exclude_channels=[u'no.*', u'maybe.*'])
    self.assertEqual(worker.apply_channel_filters([u'yes.1', u'no.1', u'maybe.2', u'yes']), [u'yes.1', u'yes'])
    worker = Worker(None, exclude_channels=[u'no.*'], only_channels=[u'yes.*'])
    self.assertEqual(worker.apply_channel_filters([u'yes.1', u'no.1', u'maybe.2', u'yes']), [u'yes.1'])
