add test
This commit is contained in:
		
							
								
								
									
										15
									
								
								tests/fixtures/ssl_tunnel_http_failure.yaml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								tests/fixtures/ssl_tunnel_http_failure.yaml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,15 @@
 | 
			
		||||
interactions:
 | 
			
		||||
- request:
 | 
			
		||||
    body: null
 | 
			
		||||
    headers: {}
 | 
			
		||||
    method: CONNECT
 | 
			
		||||
    uri: http://vcsavcsa:80
 | 
			
		||||
  response:
 | 
			
		||||
    body: {string: !!python/unicode '<HTML><BODY><H1>404 Not Found</H1></BODY></HTML>'}
 | 
			
		||||
    headers:
 | 
			
		||||
      connection: [close]
 | 
			
		||||
      content-length: ['48']
 | 
			
		||||
      content-type: [text/html]
 | 
			
		||||
      date: ['Thu, 11 Sep 2014 07:57:56 GMT']
 | 
			
		||||
    status: {code: 404, message: Not Found}
 | 
			
		||||
version: 1
 | 
			
		||||
@@ -74,5 +74,14 @@ class ConnectionTests(tests.VCRTestBase):
 | 
			
		||||
    def test_ssl_tunnel(self):
 | 
			
		||||
        connect.SoapStubAdapter('sdkTunnel', 8089, httpProxyHost='vcsa').GetConnection()
 | 
			
		||||
 | 
			
		||||
    @vcr.use_cassette('ssl_tunnel_http_failure.yaml',
 | 
			
		||||
                      cassette_library_dir=tests.fixtures_path,
 | 
			
		||||
                      record_mode='none')
 | 
			
		||||
    def test_ssl_tunnel_http_failure(self):
 | 
			
		||||
        from six.moves import http_client
 | 
			
		||||
        def should_fail():
 | 
			
		||||
            connect.SoapStubAdapter('vcsa', 80, httpProxyHost='vcsa').GetConnection()
 | 
			
		||||
        self.assertRaises(http_client.HTTPException, should_fail)
 | 
			
		||||
 | 
			
		||||
if __name__ == '__main__':
 | 
			
		||||
    unittest.main()
 | 
			
		||||
		Reference in New Issue
	
	Block a user