Пример #1
0
 def test_remove(self):
     Channels.create(self.channel_id, self.meta)
     self.assertEqual(1, Channels.count())
     Channels.remove(self.channel_id)
     self.assertEqual(0, Channels.count())
     Channels.remove(self.channel_id)
     self.assertEqual(0, Channels.count())
Пример #2
0
Файл: chat.py Проект: sbuss/qotr
    def on_close(self):
        if not self.channel:
            return

        self.channel.connections -= 1

        if self.channel.has(self):
            self.channel.part(self)
            self.broadcast(Message(MT.part, sender=self))

        if self.channel.connections <= 0:
            L.debug('Deleting channel: %s', self.channel_id)
            Channels.remove(self.channel_id)
Пример #3
0
    def on_close(self):
        if not self.channel:
            return

        self.channel.connections -= 1

        if self.channel.has(self):
            self.channel.part(self)
            self.broadcast(Message(MT.part, sender=self))

        if self.channel.connections <= 0:
            L.debug('Deleting channel: %s', self.channel_id)
            Channels.remove(self.channel_id)