def test_existing(self): self.assertFalse(Channels.exists(self.channel_id)) Channels.create(self.channel_id, self.meta) self.assertTrue(Channels.exists(self.channel_id)) with self.assertRaises(ChannelAlreadyExists): Channels.create(self.channel_id, self.meta)
def test_channel_no_delete(self): key = 'test-channel' c = Channels.create(key, 'common') c.join(Mock(nick='foo')) yield gen.sleep(config.cleanup_period * 1.1) self.assertTrue(Channels.exists(key))
def test_channel_delete(self): key = 'test-channel' Channels.create(key, 'common') yield gen.sleep(config.cleanup_period * 1.1) self.assertFalse(Channels.exists(key))
def test_reset(self): Channels.create(self.channel_id, self.meta) self.assertTrue(Channels.exists(self.channel_id)) Channels.reset() self.assertFalse(Channels.exists(self.channel_id))