Fix/update SASL tests, broken by the previous commit.

This commit is contained in:
Valentin Lorentz 2021-07-31 13:05:36 +02:00
parent 5e2c2122aa
commit ade5a02457

View File

@ -1361,10 +1361,17 @@ class SaslTestCase(SupyTestCase, CapNegMixin):
conf.supybot.networks.test.sasl.username.setValue('')
conf.supybot.networks.test.sasl.password.setValue('')
self.assertEqual(self.irc.sasl_current_mechanism, None)
self.assertEqual(self.irc.sasl_next_mechanisms, ['plain'])
self.assertEqual(self.irc.sasl_next_mechanisms,
['scram-sha-256', 'plain'])
self.startCapNegociation()
m = self.irc.takeMsg()
self.assertEqual(m, ircmsgs.IrcMsg(command='AUTHENTICATE',
args=('SCRAM-SHA-256',)))
self.irc.feedMsg(ircmsgs.IrcMsg(command='904',
args=('mechanism not available',)))
m = self.irc.takeMsg()
self.assertEqual(m, ircmsgs.IrcMsg(command='AUTHENTICATE',
args=('PLAIN',)))
@ -1392,14 +1399,19 @@ class SaslTestCase(SupyTestCase, CapNegMixin):
conf.supybot.networks.test.certfile.setValue('')
self.assertEqual(self.irc.sasl_current_mechanism, None)
self.assertEqual(self.irc.sasl_next_mechanisms,
['external', 'plain'])
['scram-sha-256', 'external', 'plain'])
self.startCapNegociation()
m = self.irc.takeMsg()
self.assertEqual(m, ircmsgs.IrcMsg(command='AUTHENTICATE',
args=('EXTERNAL',)))
args=('SCRAM-SHA-256',)))
self.irc.feedMsg(ircmsgs.IrcMsg(command='904',
args=('mechanism not available',)))
m = self.irc.takeMsg()
self.assertEqual(m, ircmsgs.IrcMsg(command='AUTHENTICATE',
args=('EXTERNAL',)))
self.irc.feedMsg(ircmsgs.IrcMsg(command='904',
args=('mechanism not available',)))
@ -1430,7 +1442,7 @@ class SaslTestCase(SupyTestCase, CapNegMixin):
conf.supybot.networks.test.certfile.setValue('')
self.assertEqual(self.irc.sasl_current_mechanism, None)
self.assertEqual(self.irc.sasl_next_mechanisms,
['external', 'plain'])
['scram-sha-256', 'external', 'plain'])
self.startCapNegociation(caps='sasl=foo,plain,bar')
@ -1458,7 +1470,8 @@ class SaslTestCase(SupyTestCase, CapNegMixin):
conf.supybot.networks.test.sasl.username.setValue('')
conf.supybot.networks.test.sasl.password.setValue('')
self.assertEqual(self.irc.sasl_current_mechanism, None)
self.assertEqual(self.irc.sasl_next_mechanisms, ['plain'])
self.assertEqual(self.irc.sasl_next_mechanisms,
['scram-sha-256', 'plain'])
self.startCapNegociation(caps='')