diff --git a/tests/test_sni.py b/tests/test_sni.py index e0632b75994721208fa911b9d03ba7aefec9a549..1885e2a33db9c6c19728854ccfc7127665a885d8 100644 --- a/tests/test_sni.py +++ b/tests/test_sni.py @@ -9,10 +9,3 @@ testinfra_hosts = AnsibleRunner('.molecule/ansible_inventory').get_hosts('all') ]) def test_sni(Command, error): assert error not in Command('pip2 install nonexistant-package').stderr - - -def test_tls12(Command): - pycommand = '''import requests; -print(requests.get('https://www.howsmyssl.com/a/check', -verify=False).json()['tls_version'])''' - assert 'TLS 1.2' == Command('python2 -c \"%s\"' % pycommand).stdout.strip() diff --git a/tests/test_tls12.py b/tests/test_tls12.py new file mode 100644 index 0000000000000000000000000000000000000000..27606103e538a2d2a2f7fc7f331aa561d7f2bd2e --- /dev/null +++ b/tests/test_tls12.py @@ -0,0 +1,10 @@ +from testinfra.utils.ansible_runner import AnsibleRunner + +testinfra_hosts = AnsibleRunner('.molecule/ansible_inventory').get_hosts('all') + + +def test_tls12(Command): + pycommand = '''import urllib2, json +print(json.loads(urllib2.urlopen(urllib2.Request( +'https://www.howsmyssl.com/a/check')).read())['tls_version'])''' + assert 'TLS 1.2' == Command('python2 -c \"%s\"' % pycommand).stdout.strip()