test incorrect PASS passwords

This commit is contained in:
Shivaram Lingamneni 2019-02-13 17:27:32 -05:00
parent 866ad726eb
commit 73237237ef

View File

@ -31,6 +31,16 @@ class PasswordedConnectionRegistrationTestCase(cases.BaseServerTestCase):
self.assertNotEqual(m.command, '001',
msg='Got 001 after NICK+USER but missing PASS')
@cases.SpecificationSelector.requiredBySpecification('RFC1459', 'RFC2812')
def testWrongPassword(self):
self.addClient()
self.sendLine(1, 'PASS {}'.format(self.password + "garbage"))
self.sendLine(1, 'NICK foo')
self.sendLine(1, 'USER username * * :Realname')
m = self.getRegistrationMessage(1)
self.assertNotEqual(m.command, '001',
msg='Got 001 after NICK+USER but incorrect PASS')
@cases.SpecificationSelector.requiredBySpecification('RFC1459', 'RFC2812')
def testPassAfterNickuser(self):
"""“The password can and must be set before any attempt to register