예제 #1
0
 def test_non_api_url_real_hash(self):
     url = 'https://protonvpn.com'
     self.s.mount(url, cert_pinning.TLSPinningAdapter())
     r = self.s.get(url)
     assert int(r.status_code) == 200
예제 #2
0
    def test_non_api_url_fake_hash(self):
        url = 'https://protonvpn.com'
        self.s.mount(url, cert_pinning.TLSPinningAdapter(fake_hashes))

        with pytest.raises(requests.exceptions.ConnectionError):
            self.s.get(url)