diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2012-06-25 16:08:54 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2012-06-25 16:08:54 (GMT) |
commit | 1dd75a64aaf8d69e851b125751deaa446de4eef1 (patch) | |
tree | b33b1e7f114e32a7a60ccd83d1bdf55ce814b711 | |
parent | 62ba0428af54d449a7dffe109ad0693f1cd8b2d4 (diff) | |
download | cpython-1dd75a64aaf8d69e851b125751deaa446de4eef1.zip cpython-1dd75a64aaf8d69e851b125751deaa446de4eef1.tar.gz cpython-1dd75a64aaf8d69e851b125751deaa446de4eef1.tar.bz2 |
Backport test_nntplib fixes from default.
-rw-r--r-- | Lib/test/test_nntplib.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/test/test_nntplib.py b/Lib/test/test_nntplib.py index 86827f3..7335b23 100644 --- a/Lib/test/test_nntplib.py +++ b/Lib/test/test_nntplib.py @@ -177,9 +177,12 @@ class NetworkedNNTPTestsMixin: self.assertTrue(resp.startswith("220 "), resp) self.check_article_resp(resp, article, art_num) # Tolerate running the tests from behind a NNTP virus checker + blacklist = lambda line: line.startswith(b'X-Antivirus') + filtered_head_lines = [line for line in head.lines + if not blacklist(line)] filtered_lines = [line for line in article.lines - if not line.startswith(b'X-Antivirus')] - self.assertEqual(filtered_lines, head.lines + [b''] + body.lines) + if not blacklist(line)] + self.assertEqual(filtered_lines, filtered_head_lines + [b''] + body.lines) def test_capabilities(self): # The server under test implements NNTP version 2 and has a |