Skip to content

Commit

Permalink
Merge pull request #191 from launchdarkly/eb/sc-180055/https-tests
Browse files Browse the repository at this point in the history
skip tests that use a self-signed TLS cert in Python 3.7
  • Loading branch information
eli-darkly authored Dec 9, 2022
2 parents 1c37c15 + 228123a commit 6e1b477
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions testing/test_ldclient_end_to_end.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,12 @@ def test_client_sends_diagnostics():
data = json.loads(r.body)
assert data['kind'] == 'diagnostic-init'

# The TLS tests are skipped in Python 3.3 because the embedded HTTPS server does not work correctly, causing
# The TLS tests are skipped in Python 3.7 because the embedded HTTPS server does not work correctly, causing
# a TLS handshake failure on the client side. It's unclear whether this is a problem with the self-signed
# certificate we are using or with some other server settings, but it does not appear to be a client-side
# problem.
# problem since we know that the SDK is able to connect to secure LD endpoints.

@pytest.mark.skipif(sys.version_info.major == 3 and sys.version_info.minor == 3, reason = "test is skipped in Python 3.3")
@pytest.mark.skipif(sys.version_info.major == 3 and sys.version_info.minor == 7, reason = "test is skipped in Python 3.7")
def test_cannot_connect_with_selfsigned_cert_by_default():
with start_secure_server() as server:
server.for_path('/sdk/latest-all', poll_content())
Expand All @@ -120,7 +120,7 @@ def test_cannot_connect_with_selfsigned_cert_by_default():
with LDClient(config = config, start_wait = 1.5) as client:
assert not client.is_initialized()

@pytest.mark.skipif(sys.version_info.major == 3 and sys.version_info.minor == 3, reason = "test is skipped in Python 3.3")
@pytest.mark.skipif(sys.version_info.major == 3 and sys.version_info.minor == 7, reason = "test is skipped in Python 3.7")
def test_can_connect_with_selfsigned_cert_if_ssl_verify_is_false():
with start_secure_server() as server:
server.for_path('/sdk/latest-all', poll_content())
Expand All @@ -134,7 +134,7 @@ def test_can_connect_with_selfsigned_cert_if_ssl_verify_is_false():
with LDClient(config = config) as client:
assert client.is_initialized()

@pytest.mark.skipif(sys.version_info.major == 3 and sys.version_info.minor == 3, reason = "test is skipped in Python 3.3")
@pytest.mark.skipif(sys.version_info.major == 3 and sys.version_info.minor == 7, reason = "test is skipped in Python 3.7")
def test_can_connect_with_selfsigned_cert_if_disable_ssl_verification_is_true():
with start_secure_server() as server:
server.for_path('/sdk/latest-all', poll_content())
Expand All @@ -148,7 +148,7 @@ def test_can_connect_with_selfsigned_cert_if_disable_ssl_verification_is_true():
with LDClient(config = config) as client:
assert client.is_initialized()

@pytest.mark.skipif(sys.version_info.major == 3 and sys.version_info.minor == 3, reason = "test is skipped in Python 3.3")
@pytest.mark.skipif(sys.version_info.major == 3 and sys.version_info.minor == 7, reason = "test is skipped in Python 3.7")
def test_can_connect_with_selfsigned_cert_by_setting_ca_certs():
with start_secure_server() as server:
server.for_path('/sdk/latest-all', poll_content())
Expand Down

0 comments on commit 6e1b477

Please sign in to comment.