progval / Limnoria

A robust, full-featured, and user/programmer-friendly Python IRC bot, with many existing plugins.
https://docs.limnoria.net/
Other
622 stars 174 forks source link

Add command to manually initiate SASL #1552

Closed glguy closed 1 year ago

progval commented 1 year ago

Could you rewrite your history to have the test changes first, then squash the rest together? This will make history easier to read and bisect

progval commented 1 year ago
diff --git a/test/test_irclib.py b/test/test_irclib.py
index 18f60b53d..2f79b2f34 100644
--- a/test/test_irclib.py
+++ b/test/test_irclib.py
@@ -1494,12 +1494,16 @@ def testBatchInterleaved(self):

 class SaslTestCase(SupyTestCase, CapNegMixin):
     def setUp(self):
-        pass
+        self._default_mechanisms = conf.supybot.networks.test.sasl.mechanisms()
+
+    def tearDown(self):
+        conf.supybot.networks.test.sasl.mechanisms.setValue(self._default_mechanisms)

     def testPlain(self):
         try:
             conf.supybot.networks.test.sasl.username.setValue('jilles')
             conf.supybot.networks.test.sasl.password.setValue('sesame')
+            conf.supybot.networks.test.sasl.mechanisms.setValue(['external', 'plain'])
             self.irc = irclib.Irc('test')

             self.startCapNegociation()
@@ -1526,11 +1530,11 @@ def testExternalFallbackToPlain(self):
         try:
             conf.supybot.networks.test.sasl.username.setValue('jilles')
             conf.supybot.networks.test.sasl.password.setValue('sesame')
+            conf.supybot.networks.test.sasl.mechanisms.setValue(['external', 'plain'])
             conf.supybot.networks.test.certfile.setValue('foo')
             self.irc = irclib.Irc('test')

             self.assertEqual(self.irc.sasl_current_mechanism, None)
-            self.irc.sasl_next_mechanisms = ['external', 'plain']

             self.startCapNegociation()

works for me after this patch

progval commented 1 year ago

Merged in 9e82e3f16cd7029077907f3ea8e491dcc3618198. Thanks again