@@ -332,19 +332,21 @@ def test_head_via_send_error(self):
332332 self .assertEqual (b'' , data )
333333
334334
335- @unittest .skipIf (ssl is None , 'No ssl module' )
335+ def certdata_file (* path ):
336+ return os .path .join (os .path .dirname (__file__ ), "certdata" , * path )
337+
338+
339+ @unittest .skipIf (ssl is None , "requires ssl" )
336340class BaseHTTPSServerTestCase (BaseTestCase ):
337- def _data_file (* name ):
338- return os .path .join (os .path .dirname (__file__ ), "certdata" , * name )
339-
340- CERTFILE = _data_file ("keycert.pem" )
341- ONLYCERT = _data_file ("ssl_cert.pem" )
342- ONLYKEY = _data_file ("ssl_key.pem" )
343- CERTFILE_PROTECTED = _data_file ("keycert.passwd.pem" )
344- ONLYKEY_PROTECTED = _data_file ("ssl_key.passwd.pem" )
341+
342+ CERTFILE = certdata_file ("keycert.pem" )
343+ ONLYCERT = certdata_file ("ssl_cert.pem" )
344+ ONLYKEY = certdata_file ("ssl_key.pem" )
345+ CERTFILE_PROTECTED = certdata_file ("keycert.passwd.pem" )
346+ ONLYKEY_PROTECTED = certdata_file ("ssl_key.passwd.pem" )
345347 KEY_PASSWORD = "somepass"
346- EMPTYCERT = _data_file ("nullcert.pem" )
347- BADCERT = _data_file ("badcert.pem" )
348+ EMPTYCERT = certdata_file ("nullcert.pem" )
349+ BADCERT = certdata_file ("badcert.pem" )
348350
349351 tls = (ONLYCERT , ONLYKEY , None ) # values by default
350352
0 commit comments