示例#1
0
    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'
示例#2
0
    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