mirror of https://github.com/progval/irctest.git
Improve error messages.
This commit is contained in:
parent
d3617b7012
commit
4ef79cbe45
|
@ -259,15 +259,15 @@ class JoinTestCase(cases.BaseServerTestCase):
|
||||||
'but: {msg}')
|
'but: {msg}')
|
||||||
m = self.getMessage(2)
|
m = self.getMessage(2)
|
||||||
self.assertNotEqual(m.command, '323', # RPL_LISTEND
|
self.assertNotEqual(m.command, '323', # RPL_LISTEND
|
||||||
'LIST response ended (ie. 323, aka RPL_LISTEND) without '
|
fail_msg='LIST response ended (ie. 323, aka RPL_LISTEND) '
|
||||||
'listing any channel, whereas there is one.')
|
'without listing any channel, whereas there is one.')
|
||||||
self.assertMessageEqual(m, command='322', # RPL_LIST
|
self.assertMessageEqual(m, command='322', # RPL_LIST
|
||||||
fail_msg='Second reply to LIST is not 322 (RPL_LIST), '
|
fail_msg='Second reply to LIST is not 322 (RPL_LIST), '
|
||||||
'nor 323 (RPL_LISTEND) but: {msg}')
|
'nor 323 (RPL_LISTEND) but: {msg}')
|
||||||
m = self.getMessage(2)
|
m = self.getMessage(2)
|
||||||
self.assertNotEqual(m.command, '322', # RPL_LIST
|
self.assertNotEqual(m.command, '322', # RPL_LIST
|
||||||
'LIST response gives (at least) two channels, whereas there '
|
fail_msg='LIST response gives (at least) two channels, '
|
||||||
'is only one.')
|
'whereas there is only one.')
|
||||||
self.assertMessageEqual(m, command='323', # RPL_LISTEND
|
self.assertMessageEqual(m, command='323', # RPL_LISTEND
|
||||||
fail_msg='Third reply to LIST is not 322 (RPL_LIST) '
|
fail_msg='Third reply to LIST is not 322 (RPL_LIST) '
|
||||||
'or 323 (RPL_LISTEND), or but: {msg}')
|
'or 323 (RPL_LISTEND), or but: {msg}')
|
||||||
|
|
|
@ -65,14 +65,17 @@ class ConnectionRegistrationTestCase(cases.BaseServerTestCase):
|
||||||
|
|
||||||
@cases.SpecificationSelector.requiredBySpecification('RFC2812')
|
@cases.SpecificationSelector.requiredBySpecification('RFC2812')
|
||||||
def testQuitErrors(self):
|
def testQuitErrors(self):
|
||||||
"""“The server must close the connection to a client which sends a
|
"""“A client session is terminated with a quit message. The server
|
||||||
QUIT message.”
|
acknowledges this by sending an ERROR message to the client.”
|
||||||
-- <https://tools.ietf.org/html/rfc1459#section-4.1.3>
|
-- <https://tools.ietf.org/html/rfc2812#section-3.1.7>
|
||||||
"""
|
"""
|
||||||
self.connectClient('foo')
|
self.connectClient('foo')
|
||||||
self.getMessages(1)
|
self.getMessages(1)
|
||||||
self.sendLine(1, 'QUIT')
|
self.sendLine(1, 'QUIT')
|
||||||
|
try:
|
||||||
commands = {m.command for me in self.getMessages(1)}
|
commands = {m.command for me in self.getMessages(1)}
|
||||||
|
except ConnectionClosed:
|
||||||
|
assert False, 'Connection closed without ERROR.'
|
||||||
self.assertIn('ERROR', commands,
|
self.assertIn('ERROR', commands,
|
||||||
fail_msg='Did not receive ERROR as a reply to QUIT.')
|
fail_msg='Did not receive ERROR as a reply to QUIT.')
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue