Ejemplo n.º 1
0
 def test_tunnel_uses_std_lib(self):
     s = FakeSocket(b'HTTP/1.1 200 OK\r\n')
     conn = AWSHTTPConnection('s3.amazonaws.com', 443)
     conn.sock = s
     # Test that the standard library method was used by patching out
     # the ``_tunnel`` method and seeing if the std lib method was called.
     with patch('urllib3.connection.HTTPConnection._tunnel') as mock_tunnel:
         conn._tunnel()
         self.assertTrue(mock_tunnel.called)
Ejemplo n.º 2
0
 def test_tunnel_uses_std_lib(self):
     s = FakeSocket(b'HTTP/1.1 200 OK\r\n')
     conn = AWSHTTPConnection('s3.amazonaws.com', 443)
     conn.sock = s
     # Test that the standard library method was used by patching out
     # the ``_tunnel`` method and seeing if the std lib method was called.
     with patch('urllib3.connection.HTTPConnection._tunnel') as mock_tunnel:
         conn._tunnel()
         self.assertTrue(mock_tunnel.called)