run_test.py 473 B

1234567891011121314151617181920212223
  1. import certifi
  2. import pip
  3. def certifi_tests():
  4. """
  5. Tests to validate certifi pkg
  6. """
  7. if hasattr(pip, 'main'):
  8. pip.main(['install', "pem"])
  9. else:
  10. pip._internal.main(['install', "pem"])
  11. certificate = certifi.where()
  12. assert certificate[-10::] == "cacert.pem", "Unable to find the certificate file"
  13. import pem
  14. certs = pem.parse_file(certificate)
  15. cert_key = str(certs[0])
  16. assert cert_key != None, "Failed to find the valid certificate "
  17. certifi_tests()