Here are the examples of the python api mock.sentinel.old_sock taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
1 Examples
3
Example 1
def setUp(self):
super(TestStarttls, self).setUp()
patcher = patch("imapclient.imapclient.tls")
self.tls = patcher.start()
self.addCleanup(patcher.stop)
self.client._imap.sock = sentinel.old_sock
self.new_sock = Mock()
self.new_sock.makefile.return_value = sentinel.file
self.tls.wrap_socket.return_value = self.new_sock
self.client.host = sentinel.host
self.client.ssl = False
self.client._starttls_done = False
self.client._imap._simple_command.return_value = "OK", [b'start TLS negotiation']