Skip to content

Commit 0af43b8

Browse files
authored
Merge pull request #290 from manics/config-dict
Test bind_dn_template more thoroughly
2 parents 7638a6e + 3782518 commit 0af43b8

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

ldapauthenticator/tests/test_ldapauthenticator.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,19 @@ async def test_ldap_auth_disallowed(c):
5353
assert authorized is None
5454

5555

56-
async def test_ldap_auth_blank_template(c):
57-
c.LDAPAuthenticator.bind_dn_template = [
56+
@pytest.mark.parametrize(
57+
"bind_dn_template",
58+
[
5859
"cn={username},ou=people,dc=planetexpress,dc=com",
59-
"",
60-
]
60+
["cn={username},ou=people,dc=planetexpress,dc=com"],
61+
[
62+
"cn={username},ou=people,dc=planetexpress,dc=com",
63+
"",
64+
],
65+
],
66+
)
67+
async def test_ldap_auth_bind_dn_template(c, bind_dn_template):
68+
c.LDAPAuthenticator.bind_dn_template = bind_dn_template
6169
authenticator = LDAPAuthenticator(config=c)
6270

6371
# proper username and password in allowed group

0 commit comments

Comments
 (0)