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

Method test_with_statement

Lib/test/test_imaplib.py:534–539  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

532 client = self.imap_class("localhost", addr, timeout=0.001)
533
534 def test_with_statement(self):
535 _, server = self._setup(SimpleIMAPHandler, connect=False)
536 with self.imap_class(*server.server_address) as imap:
537 imap.login('user', 'pass')
538 self.assertEqual(server.logged, 'user')
539 self.assertIsNone(server.logged)
540
541 def test_with_statement_logout(self):
542 # It is legal to log out explicitly inside the with block

Callers

nothing calls this directly

Calls 4

_setupMethod · 0.95
assertIsNoneMethod · 0.80
loginMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected