run_test.py 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # tests for cryptography-39.0.1-py39h9ce1e76_2 (this is a generated file);
  2. print('===== testing package: cryptography-39.0.1-py39h9ce1e76_2 =====');
  3. print('running run_test.py');
  4. # --- run_test.py (begin) ---
  5. import subprocess
  6. import time
  7. import cryptography
  8. import cryptography.fernet
  9. import cryptography.hazmat
  10. import cryptography.hazmat.backends
  11. import cryptography.hazmat.backends.openssl
  12. import cryptography.hazmat.bindings
  13. import cryptography.hazmat.bindings.openssl
  14. import cryptography.hazmat.primitives
  15. import cryptography.hazmat.primitives.asymmetric
  16. import cryptography.hazmat.primitives.ciphers
  17. import cryptography.hazmat.primitives.kdf
  18. import cryptography.hazmat.primitives.twofactor
  19. import cryptography.x509
  20. from cryptography.hazmat.backends.openssl import backend
  21. # the version that cryptography uses
  22. linked_version = backend.openssl_version_text()
  23. # the version present in the conda environment
  24. env_version = subprocess.check_output('openssl version', shell=True).decode('utf8').strip()
  25. print(f'Version used by cryptography:\n{linked_version}')
  26. print(f'Version in conda environment:\n{env_version}')
  27. # avoid race condition between print and (possible) AssertionError
  28. time.sleep(1)
  29. # linking problems have appeared on windows before (see issue #38),
  30. # and were only caught by lucky accident through the test suite.
  31. # This is intended to ensure it does not happen again.
  32. assert env_version.startswith(linked_version)
  33. # --- run_test.py (end) ---
  34. print('===== cryptography-39.0.1-py39h9ce1e76_2 OK =====');