diff options
| author | Barry Warsaw | 2014-12-17 17:58:34 -0500 |
|---|---|---|
| committer | Barry Warsaw | 2014-12-17 17:58:34 -0500 |
| commit | 7af22e0d239391cd9f8a49a696486b79632aaa86 (patch) | |
| tree | e07c50babc719728727f1fe8b7390d55a85c70ad /src | |
| parent | cd7f4d15426511f8679e96731e837c2926e65578 (diff) | |
| download | mailman-7af22e0d239391cd9f8a49a696486b79632aaa86.tar.gz mailman-7af22e0d239391cd9f8a49a696486b79632aaa86.tar.zst mailman-7af22e0d239391cd9f8a49a696486b79632aaa86.zip | |
Diffstat (limited to 'src')
| -rw-r--r-- | src/mailman/runners/nntp.py | 2 | ||||
| -rw-r--r-- | src/mailman/runners/tests/test_nntp.py | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/mailman/runners/nntp.py b/src/mailman/runners/nntp.py index 7d9c189cc..5d0013055 100644 --- a/src/mailman/runners/nntp.py +++ b/src/mailman/runners/nntp.py @@ -82,7 +82,7 @@ class NNTPRunner(Runner): user=config.nntp.user, password=config.nntp.password) conn.post(fp) - except nntplib.error_temp: + except nntplib.NNTPTemporaryError: log.exception('{0} NNTP error for {1}'.format( msg.get('message-id', 'n/a'), mlist.fqdn_listname)) except socket.error: diff --git a/src/mailman/runners/tests/test_nntp.py b/src/mailman/runners/tests/test_nntp.py index 24db00285..df3ea8c4b 100644 --- a/src/mailman/runners/tests/test_nntp.py +++ b/src/mailman/runners/tests/test_nntp.py @@ -310,8 +310,9 @@ Testing mark = LogFileMark('mailman.error') self._runner.run() log_message = mark.readline()[:-1] - self.assertTrue(log_message.endswith( - 'NNTP error for test@example.com')) + self.assertTrue( + log_message.endswith('NNTP error for test@example.com'), + log_message) @mock.patch('nntplib.NNTP', side_effect=socket.error) def test_connect_with_socket_failure(self, class_mock): @@ -338,7 +339,7 @@ Testing 'NNTP unexpected exception for test@example.com')) messages = get_queue_messages('nntp') self.assertEqual(len(messages), 1) - self.assertEqual(messages[0].msgdata['listname'], 'test@example.com') + self.assertEqual(messages[0].msgdata['listid'], 'test.example.com') self.assertEqual(messages[0].msg['subject'], 'A newsgroup posting') @mock.patch('nntplib.NNTP', side_effect=nntplib.NNTPTemporaryError) |
