From 3d0b493a112c2116bd701a4c10bf47801b4d8851 Mon Sep 17 00:00:00 2001 From: Daniel Oaks Date: Wed, 1 Nov 2017 23:33:43 +0000 Subject: [PATCH] Don't send empty CAP REQ --- irctest/cases.py | 2 +- irctest/server_tests/test_echo_message.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/irctest/cases.py b/irctest/cases.py index a5924d4..3315004 100644 --- a/irctest/cases.py +++ b/irctest/cases.py @@ -331,7 +331,7 @@ class BaseServerTestCase(_IrcTestCase): def connectClient(self, nick, name=None, capabilities=None, skip_if_cap_nak=False): client = self.addClient(name) - if capabilities is not None: + if capabilities is not None and 0 < len(capabilities): self.sendLine(client, 'CAP REQ :{}'.format(' '.join(capabilities))) m = self.getRegistrationMessage(client) try: diff --git a/irctest/server_tests/test_echo_message.py b/irctest/server_tests/test_echo_message.py index a44a5f4..def4d39 100644 --- a/irctest/server_tests/test_echo_message.py +++ b/irctest/server_tests/test_echo_message.py @@ -38,7 +38,7 @@ class EchoMessageTestCase(cases.BaseServerTestCase): self.sendLine(1, 'JOIN #chan') if not solo: - capabilities = ['server-time'] if server_time else [] + capabilities = ['server-time'] if server_time else None self.connectClient('qux', capabilities=capabilities) self.sendLine(2, 'JOIN #chan')