def test_good_url_expired_cert(self): '''correctly formatted url, but certificate expired''' cases = [ 'https://s3.amazonaws.com/echo.api/echo-api-cert.pem', 'https://s3.amazonaws.com:443/echo.api/echo-api-cert.pem', ] for case in cases: assert util._get_certificate(case) is None assert self.last_log() == 'certificate expired or invalid\n'
def test_bogus_urls(self): '''explicitly given by amazon docs as failure cases''' cases = [ 'http://s3.amazonaws.com/echo.api/echo-api-cert.pem', 'https://notamazon.com/echo.api/echo-api-cert.pem', 'https://s3.amazonaws.com/EcHo.aPi/echo-api-cert.pem', 'https://s3.amazonaws.com/invalid.path/echo-api-cert.pem', 'https://s3.amazonaws.com:563/echo.api/echo-api-cert.pem', ] for case in cases: assert util._get_certificate(case) is None assert self.last_log() == 'invalid cert location %s\n' % case