mirror of
https://github.com/progval/irctest.git
synced 2025-04-06 23:39:46 +00:00
Prevent 433 response for Nonutf8{User/Real}name (#244)
Sending `NICK foo` after connectClient() causes an ERR_NICKNAMEINUSE response instead of the expected RPL_WELCOME.
This commit is contained in:
@ -54,15 +54,15 @@ class Utf8TestCase(cases.BaseServerTestCase):
|
||||
raise runner.IsupportTokenNotSupported("UTF8ONLY")
|
||||
|
||||
self.addClient()
|
||||
self.sendLine(2, "NICK foo")
|
||||
self.sendLine(2, "NICK bar")
|
||||
self.clients[2].conn.sendall(b"USER username * * :i\xe8rc\xe9\r\n")
|
||||
|
||||
d = self.clients[2].conn.recv(1024)
|
||||
if b" FAIL " in d or b" 468 " in d: # ERR_INVALIDUSERNAME
|
||||
if b"FAIL " in d or b"468 " in d: # ERR_INVALIDUSERNAME
|
||||
return # nothing more to test
|
||||
self.assertIn(b" 001 ", d)
|
||||
self.assertIn(b"001 ", d)
|
||||
|
||||
self.sendLine(2, "WHOIS foo")
|
||||
self.sendLine(2, "WHOIS bar")
|
||||
self.getMessages(2)
|
||||
|
||||
def testNonutf8Username(self):
|
||||
@ -71,7 +71,7 @@ class Utf8TestCase(cases.BaseServerTestCase):
|
||||
raise runner.IsupportTokenNotSupported("UTF8ONLY")
|
||||
|
||||
self.addClient()
|
||||
self.sendLine(2, "NICK foo")
|
||||
self.sendLine(2, "NICK bar")
|
||||
self.sendLine(2, "USER 😊😊😊😊😊😊😊😊😊😊 * * :realname")
|
||||
m = self.getRegistrationMessage(2)
|
||||
if m.command in ("FAIL", "468"): # ERR_INVALIDUSERNAME
|
||||
@ -80,7 +80,7 @@ class Utf8TestCase(cases.BaseServerTestCase):
|
||||
m,
|
||||
command="001",
|
||||
)
|
||||
self.sendLine(2, "WHOIS foo")
|
||||
self.sendLine(2, "WHOIS bar")
|
||||
self.getMessages(2)
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user