Skip to content

Commit

Permalink
Merge pull request #290 from manics/config-dict
Browse files Browse the repository at this point in the history
Test bind_dn_template more thoroughly
  • Loading branch information
consideRatio authored Oct 31, 2024
2 parents 7638a6e + 3782518 commit 0af43b8
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions ldapauthenticator/tests/test_ldapauthenticator.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,19 @@ async def test_ldap_auth_disallowed(c):
assert authorized is None


async def test_ldap_auth_blank_template(c):
c.LDAPAuthenticator.bind_dn_template = [
@pytest.mark.parametrize(
"bind_dn_template",
[
"cn={username},ou=people,dc=planetexpress,dc=com",
"",
]
["cn={username},ou=people,dc=planetexpress,dc=com"],
[
"cn={username},ou=people,dc=planetexpress,dc=com",
"",
],
],
)
async def test_ldap_auth_bind_dn_template(c, bind_dn_template):
c.LDAPAuthenticator.bind_dn_template = bind_dn_template
authenticator = LDAPAuthenticator(config=c)

# proper username and password in allowed group
Expand Down

0 comments on commit 0af43b8

Please sign in to comment.