小草林(田梓萱)
90db12dfc0
Some checks failed
Lock closed issues/PRs / lock (push) Has been cancelled
Test / Sentry self-hosted end-to-end tests (push) Has been cancelled
Test / unit tests (push) Has been cancelled
Test / Sentry upgrade test (push) Has been cancelled
Test / integration test v2.19.0 - customizations disabled (push) Has been cancelled
Test / integration test v2.19.0 - customizations enabled (push) Has been cancelled
Test / integration test v2.26.0 - customizations disabled (push) Has been cancelled
Test / integration test v2.26.0 - customizations enabled (push) Has been cancelled
Signed-off-by: 小草林(田梓萱) <xcl@xuegao-tzx.top>
17 lines
382 B
Python
17 lines
382 B
Python
import unittest
|
|
|
|
import requests
|
|
|
|
|
|
class CustomCATests(unittest.TestCase):
|
|
def test_valid_self_signed(self):
|
|
self.assertEqual(requests.get("https://self.test").text, "ok")
|
|
|
|
def test_invalid_self_signed(self):
|
|
with self.assertRaises(requests.exceptions.SSLError):
|
|
requests.get("https://fail.test")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|