Abhilash Raj pushed to branch master at GNU Mailman / Mailman Core


Commits:
6414b6c2 by Abhilash Raj at 2019-12-14T12:02:38-08:00
Fix dnsfunc used in the unittests for v1.0.0 of dkimpy.

- - - - -
f54f1252 by Abhilash Raj at 2019-12-14T20:14:17+00:00
Merge branch 'fix-tests' into 'master'

Fix dnsfunc used in the unittests for v1.0.0 of dkimpy.

Closes #655

See merge request mailman/mailman!579
- - - - -


2 changed files:

- src/mailman/docs/NEWS.rst
- src/mailman/handlers/tests/test_arc_validate.py


Changes:

=====================================
src/mailman/docs/NEWS.rst
=====================================
@@ -25,6 +25,8 @@ Bugs
   banned subscription address would cause a shunted message.  (Closes #643)
 * Fixed a bug where the ``postfix_vmap`` file would merge two columns for long
   domain names. (Closes #651)
+* Fix failing test cases due to changed API in a new version of dkimpy. (Closes
+  #655)
 
 
 3.3.0 -- "Tom Sawyer"


=====================================
src/mailman/handlers/tests/test_arc_validate.py
=====================================
@@ -32,6 +32,15 @@ from mailman.testing.layers import ConfigLayer
 from unittest.mock import patch
 
 
+def get_mock_dnsfunc(mapping):
+    """Mock dnsfunc to pass to load_pk_from_dns."""
+
+    def mock_dnsfunc(dom, **kw):
+        return mapping.get(dom)
+
+    return mock_dnsfunc
+
+
 class TestValidateAuthenticity(unittest.TestCase):
     """Test Authentication-Results generation."""
     layer = ConfigLayer
@@ -60,7 +69,8 @@ class TestValidateAuthenticity(unittest.TestCase):
         records = {b"google2048._domainkey.valimail.com.": ''.join(dkim0),
                    b"_dmarc.valimail.com.": ''.join(dmarc),
                    b"dummy._domainkey.example.org.": ''.join(dkim1)}
-        mailman.handlers.validate_authenticity.dnsfunc = records.get
+        mailman.handlers.validate_authenticity.dnsfunc = get_mock_dnsfunc(
+            records)
         self.keyfile = tempfile.NamedTemporaryFile(delete=True)
 
     def tearDown(self):



View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/0698bfcd331b6df733e4ffad1bd9e41a0dba344f...f54f125294f2c0b4ddcecd05c46f4b940a2f1526

-- 
View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/0698bfcd331b6df733e4ffad1bd9e41a0dba344f...f54f125294f2c0b4ddcecd05c46f4b940a2f1526
You're receiving this email because of your account on gitlab.com.


_______________________________________________
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org

Reply via email to