Skip TLS version test if TLSv1_2 is not available on platform

Signed-off-by: Joffrey F <joffrey@docker.com>
This commit is contained in:
Joffrey F 2016-06-14 12:23:04 -07:00
parent 0fe82614a6
commit ee68a51e28
1 changed files with 1 additions and 0 deletions

View File

@ -55,6 +55,7 @@ class TestGetTlsVersion(object):
environment = {} environment = {}
assert get_tls_version(environment) is None assert get_tls_version(environment) is None
@pytest.mark.skipif(not hasattr(ssl, 'PROTOCOL_TLSv1_2'), reason='TLS v1.2 unsupported')
def test_get_tls_version_upgrade(self): def test_get_tls_version_upgrade(self):
environment = {'COMPOSE_TLS_VERSION': 'TLSv1_2'} environment = {'COMPOSE_TLS_VERSION': 'TLSv1_2'}
assert get_tls_version(environment) == ssl.PROTOCOL_TLSv1_2 assert get_tls_version(environment) == ssl.PROTOCOL_TLSv1_2