Skip to content

Commit

Permalink
tests: Add then for Authentication to Dex
Browse files Browse the repository at this point in the history
Add single `then` to handle Dex authentication success or fail, so that
we can add a single `then` to check Dex authentication result
  • Loading branch information
TeddyAndrieux committed May 27, 2020
1 parent 59928f6 commit 12028b4
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions tests/post/steps/test_authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,42 @@ def successful_login(host, context, status_code):
assert auth_response.headers.get('location') is not None


@then(parsers.parse(
"we are able to login to Dex as '{username}' using password '{password}'"))
def dex_login_success(
host,
control_plane_ip,
username,
password,
context,
request_retry_session
):
dex_login(
host, control_plane_ip,
username, password,
context, request_retry_session
)
successful_login(host, context, '303')


@then(parsers.parse(
"we are not able to login to Dex as '{username}' using password "
"'{password}'"))
def dex_login_fail(
host,
control_plane_ip,
username,
password,
context,
request_retry_session
):
dex_login(
host, control_plane_ip,
username, password,
context, request_retry_session
)
failed_login(host, context)

# }}}


Expand Down

0 comments on commit 12028b4

Please sign in to comment.