Ticket #4929: 4929.patch

File 4929.patch, 1.5 KB (added by taos, 6 years ago)

Patch containing method and unit tests.

  • twisted/words/test/test_irc.py

     
    12731273        self.lines.append(m)
    12741274
    12751275
     1276class ClientListTests(unittest.TestCase):
     1277    def setUp(self):
     1278        """
     1279        Create a L{DummyClient} to call C{list} on.
     1280        """
     1281        self.client = DummyClient()
    12761282
     1283
     1284    def test_list(self):
     1285        """
     1286        Test if the LIST function actually through
     1287        """
     1288        self.client.channel_list()
     1289        self.assertEquals(self.client.lines, ['LIST'])
     1290
     1291
    12771292class ClientInviteTests(unittest.TestCase):
    12781293    """
    12791294    Tests for L{IRCClient.invite}.
     
    13031318        self.assertEquals(self.client.lines, ['INVITE foo #bar'])
    13041319
    13051320
    1306 
    13071321class ClientMsgTests(unittest.TestCase):
    13081322    def setUp(self):
    13091323        self.client = DummyClient()
  • twisted/words/protocols/irc.py

     
    13861386        self.sendLine("INVITE %s %s" % (user, channel))
    13871387
    13881388
     1389    def channel_list(self):
     1390        """
     1391        Attempts to ask for the LIST which is every channel on the server.
     1392
     1393        @since: 11.0
     1394        """
     1395        self.sendLine("LIST")
     1396
    13891397    def topic(self, channel, topic=None):
    13901398        """
    13911399        Attempt to set the topic of the given channel, or ask what it is.