]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Ignore X-Antivirus headers in test_nntplib
authorNick Coghlan <ncoghlan@gmail.com>
Sun, 17 Jun 2012 11:27:18 +0000 (21:27 +1000)
committerNick Coghlan <ncoghlan@gmail.com>
Sun, 17 Jun 2012 11:27:18 +0000 (21:27 +1000)
Lib/test/test_nntplib.py
Misc/NEWS

index cc490f1e97ed8aabb3b659c22b1f6b6541a17712..86827f37f5be7909ab9978cc5b9d599ed8bc6f0a 100644 (file)
@@ -176,7 +176,10 @@ class NetworkedNNTPTestsMixin:
         resp, article = self.server.article(art_num)
         self.assertTrue(resp.startswith("220 "), resp)
         self.check_article_resp(resp, article, art_num)
-        self.assertEqual(article.lines, head.lines + [b''] + body.lines)
+        # Tolerate running the tests from behind a NNTP virus checker
+        filtered_lines = [line for line in article.lines
+                                  if not line.startswith(b'X-Antivirus')]
+        self.assertEqual(filtered_lines, head.lines + [b''] + body.lines)
 
     def test_capabilities(self):
         # The server under test implements NNTP version 2 and has a
index 53b596696c764b6fbd5d8c1472683eb154210a5f..446688c01a059d78c2a7f3e0ab5747e7fafb18d7 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -301,6 +301,9 @@ Extension Modules
 Tests
 -----
 
+- test_nntplib now tolerates being run from behind NNTP gateways that add
+  "X-Antivirus" headers to articles
+
 - Issue #15043: test_gdb is now skipped entirely if gdb security settings
   block loading of the gdb hooks