How to use the fpl.models.user._set_captain function in fpl

To help you get started, we’ve selected a few fpl examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github amosbastian / fpl / tests / test_user.py View on Github external
def test__set_captain_captain():
        user_picks = get_picks()
        captain = next(p for p in user_picks if p["is_captain"])
        _set_captain(user_picks, 145, "is_captain", user_player_ids)

        new_captain = next(p for p in user_picks if p["is_captain"])

        assert new_captain["element"] == 145
        assert not captain["is_captain"]
github amosbastian / fpl / tests / test_user.py View on Github external
def test__set_captain_captain_to_vice():
        user_picks = get_picks()
        captain = next(p for p in user_picks if p["is_captain"])
        vice_captain = next(p for p in user_picks if p["is_vice_captain"])
        _set_captain(user_picks, 270, "is_vice_captain", user_player_ids)

        new_captain = next(p for p in user_picks if p["is_captain"])
        new_vice_captain = next(p for p in user_picks if p["is_vice_captain"])

        assert new_captain["element"] == vice_captain["element"]
        assert new_vice_captain["element"] == captain["element"]
github amosbastian / fpl / tests / test_user.py View on Github external
def test__set_captain_vice_to_vice():
        user_picks = get_picks()
        vice_captain = next(p for p in user_picks if p["is_vice_captain"])
        _set_captain(user_picks, 302, "is_vice_captain", user_player_ids)
        new_vice_captain = next(p for p in user_picks if p["is_vice_captain"])

        assert new_vice_captain["element"] == vice_captain["element"]
github amosbastian / fpl / tests / test_user.py View on Github external
def test__set_captain_vice_to_captain():
        user_picks = get_picks()
        captain = next(p for p in user_picks if p["is_captain"])
        vice_captain = next(p for p in user_picks if p["is_vice_captain"])
        _set_captain(user_picks, 302, "is_captain", user_player_ids)

        new_captain = next(p for p in user_picks if p["is_captain"])
        new_vice_captain = next(p for p in user_picks if p["is_vice_captain"])

        assert new_vice_captain["element"] == captain["element"]
        assert new_captain["element"] == vice_captain["element"]
github amosbastian / fpl / tests / test_user.py View on Github external
def test__set_captain_captain_to_captain():
        user_picks = get_picks()
        captain = next(p for p in user_picks if p["is_captain"])
        _set_captain(user_picks, 270, "is_captain", user_player_ids)
        new_captain = next(p for p in user_picks if p["is_captain"])

        assert new_captain["element"] == captain["element"]
github amosbastian / fpl / tests / test_user.py View on Github external
def test__set_captain_vice():
        user_picks = get_picks()
        vice_captain = next(p for p in user_picks if p["is_vice_captain"])
        _set_captain(user_picks, 145, "is_vice_captain", user_player_ids)

        new_vice_captain = next(p for p in user_picks if p["is_vice_captain"])

        assert new_vice_captain["element"] == 145
        assert not vice_captain["is_vice_captain"]