mirror of
				https://github.com/python/cpython.git
				synced 2025-11-03 23:21:29 +00:00 
			
		
		
		
	test_ftplib: skip check_hostname test when SNI is not available
This commit is contained in:
		
							parent
							
								
									a5f0eda91a
								
							
						
					
					
						commit
						e7945d76ff
					
				
					 1 changed files with 4 additions and 0 deletions
				
			
		| 
						 | 
					@ -15,6 +15,9 @@
 | 
				
			||||||
    import ssl
 | 
					    import ssl
 | 
				
			||||||
except ImportError:
 | 
					except ImportError:
 | 
				
			||||||
    ssl = None
 | 
					    ssl = None
 | 
				
			||||||
 | 
					    HAS_SNI = False
 | 
				
			||||||
 | 
					else:
 | 
				
			||||||
 | 
					    from ssl import HAS_SNI
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from unittest import TestCase, skipUnless
 | 
					from unittest import TestCase, skipUnless
 | 
				
			||||||
from test import support
 | 
					from test import support
 | 
				
			||||||
| 
						 | 
					@ -924,6 +927,7 @@ def test_ccc(self):
 | 
				
			||||||
        self.client.ccc()
 | 
					        self.client.ccc()
 | 
				
			||||||
        self.assertRaises(ValueError, self.client.sock.unwrap)
 | 
					        self.assertRaises(ValueError, self.client.sock.unwrap)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @unittest.skipUnless(HAS_SNI, 'No SNI support in ssl module')
 | 
				
			||||||
    def test_check_hostname(self):
 | 
					    def test_check_hostname(self):
 | 
				
			||||||
        self.client.quit()
 | 
					        self.client.quit()
 | 
				
			||||||
        ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
 | 
					        ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue