ut_dep.py 595 B

12345678910111213141516171819202122232425
  1. #!/usr/bin/env python3
  2. """
  3. test.unit_tests_d.ut_dep: dependency unit tests for the MMGen suite
  4. Test whether dependencies are installed and functional.
  5. No data verification is performed.
  6. """
  7. from mmgen.common import *
  8. class unit_tests:
  9. def pysocks(self,name,ut):
  10. import requests,urllib3
  11. urllib3.disable_warnings()
  12. session = requests.Session()
  13. session.proxies.update({'https':'socks5h://127.243.172.8:20677'})
  14. try:
  15. session.get('https://127.188.29.17')
  16. except Exception as e:
  17. if type(e).__name__ == 'ConnectionError':
  18. return True
  19. else:
  20. print(e)
  21. return False