MCPcopy Index your code
hub / github.com/python/cpython / test_with_statement_QUIT_failure

Method test_with_statement_QUIT_failure

Lib/test/test_smtplib.py:1277–1283  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1275 self.assertRaises(smtplib.SMTPServerDisconnected, smtp.send, b'foo')
1276
1277 def test_with_statement_QUIT_failure(self):
1278 with self.assertRaises(smtplib.SMTPResponseException) as error:
1279 with smtplib.SMTP(HOST, self.port) as smtp:
1280 smtp.noop()
1281 self.serv._SMTPchannel.quit_response = '421 QUIT FAILED'
1282 self.assertEqual(error.exception.smtp_code, 421)
1283 self.assertEqual(error.exception.smtp_error, b'QUIT FAILED')
1284
1285 #TODO: add tests for correct AUTH method fallback now that the
1286 #test infrastructure can support it.

Callers

nothing calls this directly

Calls 3

assertRaisesMethod · 0.45
noopMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected