[tor-commits] [bridgedb/master] Add unittest for checkDKIM() with two `X-DKIM-Authentication-Results:` headers.

isis at torproject.org isis at torproject.org
Fri Jun 6 23:39:15 UTC 2014


commit 712f11699ad799e5df9d21fe5e63c8d73652eb05
Author: Isis Lovecruft <isis at torproject.org>
Date:   Thu Jun 5 03:01:42 2014 +0000

    Add unittest for checkDKIM() with two `X-DKIM-Authentication-Results:` headers.
    
     * ADD a new unittest, test_checkDKIM_good_dunno(), to
       test_email_dkim.py, which checks that a received email with two
       ``X-DKIM-Authentication-Results:`` headers (the first one good, the
       second ``dunno``) properly returns False.
    
     * FIXES #12091. Actually, it doesn't. It just proves that the changes
       in my `fix/9874-automate-email-tests` branch fix #12091. Either way,
       it's fixed, these unittests prove it.
---
 lib/bridgedb/test/test_email_dkim.py |   11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/lib/bridgedb/test/test_email_dkim.py b/lib/bridgedb/test/test_email_dkim.py
index ee022b0..499a3c1 100644
--- a/lib/bridgedb/test/test_email_dkim.py
+++ b/lib/bridgedb/test/test_email_dkim.py
@@ -73,3 +73,14 @@ get bridges
         result = dkim.checkDKIM(message,
                                 self.domainRules.get("gmail.com"))
         self.assertIs(result, False)
+
+    def test_checkDKIM_good_dunno(self):
+        """A good DKIM verification header, *plus* an
+        ``X-DKIM-Authentication-Results: dunno`` header should return False.
+        """
+        messageList = self.badMessage.split('\n')
+        messageList.insert(2, "X-DKIM-Authentication-Results: dunno")
+        message = self._createMessage('\n'.join(messageList))
+        result = dkim.checkDKIM(message,
+                                self.domainRules.get("gmail.com"))
+        self.assertIs(result, False)





More information about the tor-commits mailing list