Skip to content

Commit

Permalink
Adjust use_ssl test to check deprecation logics function
Browse files Browse the repository at this point in the history
  • Loading branch information
consideRatio committed Sep 15, 2024
1 parent df38bd1 commit df67ba7
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions ldapauthenticator/tests/test_ldapauthenticator.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
https://github.com/rroemhild/docker-test-openldap?tab=readme-ov-file#ldap-structure
"""

from ..ldapauthenticator import TlsStrategy


async def test_ldap_auth_allowed(authenticator):
# proper username and password in allowed group
Expand Down Expand Up @@ -56,14 +58,13 @@ async def test_ldap_auth_blank_template(authenticator):
assert authorized["name"] == "fry"


async def test_ldap_auth_ssl(authenticator):
authenticator.use_ssl = True
async def test_ldap_use_ssl_deprecation(authenticator):
assert authenticator.tls_strategy == TlsStrategy.before_bind

# proper username and password in allowed group
authorized = await authenticator.get_authenticated_user(
None, {"username": "fry", "password": "fry"}
)
assert authorized["name"] == "fry"
# setting use_ssl to True should result in tls_strategy being set to
# on_connect
authenticator.use_ssl = True
assert authenticator.tls_strategy == TlsStrategy.on_connect


async def test_ldap_auth_tls_strategy_on_connect(authenticator):
Expand Down

0 comments on commit df67ba7

Please sign in to comment.