add dependency unit test (WIP)

This commit is contained in:
The MMGen Project 2021-09-23 21:15:33 +00:00
commit 511aa79fc8
Signed by: mmgen
GPG key ID: 3F8B1861E32B7DA2

22
test/unit_tests_d/ut_dep.py Executable file
View file

@ -0,0 +1,22 @@
#!/usr/bin/env python3
"""
test.unit_tests_d.ut_rpc: dependency unit tests for the MMGen suite
"""
from mmgen.common import *
class unit_tests:
def pysocks(self,name,ut):
import requests,urllib3
urllib3.disable_warnings()
session = requests.Session()
session.proxies.update({'https':'socks5h://127.243.172.8:20677'})
try:
session.get('https://127.188.29.17')
except Exception as e:
if type(e).__name__ == 'ConnectionError':
return True
else:
print(e)
return False