Skip to content

Commit

Permalink
Refactor test names
Browse files Browse the repository at this point in the history
  • Loading branch information
Askaholic committed Jan 1, 2024
1 parent cbf1ce1 commit 5ec6398
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions tests/integration_tests/test_login.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
)


async def test_server_invalid_login(lobby_server):
async def test_server_login_invalid(lobby_server):
proto = await connect_client(lobby_server)
# Try a user that doesn't exist
await perform_login(proto, ("Cat", "epic"))
Expand Down Expand Up @@ -53,7 +53,7 @@ async def test_server_ban_revoked_or_expired(lobby_server, user):
assert msg["login"] == user


async def test_server_valid_login(lobby_server):
async def test_server_login_valid(lobby_server):
proto = await connect_client(lobby_server)
await perform_login(proto, ("Rhiza", "puff_the_magic_dragon"))
msg = await proto.read_message()
Expand Down Expand Up @@ -98,7 +98,7 @@ async def test_server_valid_login(lobby_server):
}


async def test_server_valid_login_admin(lobby_server):
async def test_server_login_valid_admin(lobby_server):
proto = await connect_client(lobby_server)
await perform_login(proto, ("test", "test_password"))
msg = await proto.read_message()
Expand Down Expand Up @@ -143,7 +143,7 @@ async def test_server_valid_login_admin(lobby_server):
}


async def test_server_valid_login_moderator(lobby_server):
async def test_server_login_valid_moderator(lobby_server):
proto = await connect_client(lobby_server)
await perform_login(proto, ("moderator", "moderator"))
msg = await proto.read_message()
Expand Down Expand Up @@ -202,7 +202,7 @@ async def test_policy_server_contacted(lobby_server, policy_server, player_servi
policy_server.verify.assert_called_once()


async def test_server_double_login(lobby_server):
async def test_server_login_double(lobby_server):
proto = await connect_client(lobby_server)
await perform_login(proto, ("test", "test_password"))
msg = await proto.read_message()
Expand All @@ -222,7 +222,7 @@ async def test_server_double_login(lobby_server):
}


async def test_server_valid_login_with_token(lobby_server, jwk_priv_key, jwk_kid):
async def test_server_login_token_valid(lobby_server, jwk_priv_key, jwk_kid):
proto = await connect_client(lobby_server)
await proto.send_message({
"command": "auth",
Expand Down Expand Up @@ -285,7 +285,7 @@ async def test_server_valid_login_with_token(lobby_server, jwk_priv_key, jwk_kid
}


async def test_server_login_bad_id_in_token(lobby_server, jwk_priv_key, jwk_kid):
async def test_server_login_token_bad_id(lobby_server, jwk_priv_key, jwk_kid):
proto = await connect_client(lobby_server)
await proto.send_message({
"command": "auth",
Expand All @@ -311,7 +311,7 @@ async def test_server_login_bad_id_in_token(lobby_server, jwk_priv_key, jwk_kid)
}


async def test_server_login_expired_token(lobby_server, jwk_priv_key, jwk_kid):
async def test_server_login_token_expired(lobby_server, jwk_priv_key, jwk_kid):
proto = await connect_client(lobby_server)
await proto.send_message({
"command": "auth",
Expand All @@ -333,7 +333,7 @@ async def test_server_login_expired_token(lobby_server, jwk_priv_key, jwk_kid):
}


async def test_server_login_malformed_token(lobby_server, jwk_priv_key, jwk_kid):
async def test_server_login_token_malformed(lobby_server, jwk_priv_key, jwk_kid):
"""This scenario could only happen if the hydra signed a token that
was missing critical data"""
proto = await connect_client(lobby_server)
Expand All @@ -355,7 +355,11 @@ async def test_server_login_malformed_token(lobby_server, jwk_priv_key, jwk_kid)
}


async def test_server_login_lobby_scope_missing(lobby_server, jwk_priv_key, jwk_kid):
async def test_server_login_token_lobby_scope_missing(
lobby_server,
jwk_priv_key,
jwk_kid,
):
"""This scenario could only happen if the hydra signed a token that
was missing critical data"""
proto = await connect_client(lobby_server)
Expand Down

0 comments on commit 5ec6398

Please sign in to comment.