Пример #1
0
def test_invalid_session_squad(fill_players):
    with test_session_scope() as ts:
        reset_session_squad(session_id=API_SESSION_ID, dbsession=ts)
        assert not validate_session_squad(API_SESSION_ID, ts)
        # add one player - check it is still invalid
        assert add_session_player(5, API_SESSION_ID, ts)
        assert not validate_session_squad(API_SESSION_ID, ts)
Пример #2
0
def test_valid_session_squad(fill_players):
    with test_session_scope() as ts:
        reset_session_squad(API_SESSION_ID, ts)
        for pid in range(15):
            assert add_session_player(pid, API_SESSION_ID, ts)
        assert validate_session_squad(API_SESSION_ID, ts)
Пример #3
0
def validate_session_players():
    """
    Check that the squad has 15 players, and obeys constraints.
    """
    valid = validate_session_squad(session_id=get_session_id())
    return create_response(valid)