diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2012-06-24 16:28:18 +0200 |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2012-06-24 16:28:18 +0200 |
commit | 1f5d2a087c715eec5972800e1fa9c5a4daac32d2 (patch) | |
tree | ba18db2b3093842da2e841c99248eada96c88d76 /Lib/test/test_nntplib.py | |
parent | 5f762af3bcfada7bb1a79c3ca78c6f3292dcc4ef (diff) | |
download | cpython-git-1f5d2a087c715eec5972800e1fa9c5a4daac32d2.tar.gz |
Fix test to really run behind a NNTP virus checker
Diffstat (limited to 'Lib/test/test_nntplib.py')
-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 e115523678..19fb10a9c7 100644 --- a/Lib/test/test_nntplib.py +++ b/Lib/test/test_nntplib.py @@ -178,9 +178,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 |