Ejemplo n.º 1
0
def test_bad_division():
    pyball = PyBall()
    with pytest.raises(BadRequestError):
        pyball.get_division_by_id("InvalidID")
Ejemplo n.º 2
0
def test_stats_group():
    pyball = PyBall()
    return pyball.get_stats_groups()
Ejemplo n.º 3
0
def test_league_leader_types():
    pyball = PyBall()
    return pyball.get_league_leader_types()
Ejemplo n.º 4
0
def test_prospects():
    pyball = PyBall()
    return pyball.get_draft_prospects_by_year(2017)
Ejemplo n.º 5
0
def test_bad_draft_year():
    pyball = PyBall()
    with pytest.raises(BadRequestError):
        pyball.get_draft_by_year("BadYear")
Ejemplo n.º 6
0
def test_get_season():
    pyball = PyBall()
    with pytest.raises(NotImplementedError):
        pyball.get_seasons()
Ejemplo n.º 7
0
def test_get_season_took_too_long():
    pyball = PyBall()
    with pytest.raises(TookTooLongError):
        pyball._get("{0}/seasons".format(BASE_URL))
Ejemplo n.º 8
0
def test_metrics():
    pyball = PyBall()
    return pyball.get_metrics()
Ejemplo n.º 9
0
def test_event_types():
    pyball = PyBall()
    return pyball.get_event_types()
Ejemplo n.º 10
0
def test_venue_id_not_a_num():
    pyball = PyBall()
    with pytest.raises(BadRequestError):
        pyball.get_venue("not_an_id")
Ejemplo n.º 11
0
def test_venue():
    pyball = PyBall()
    return pyball.get_venue(1)
Ejemplo n.º 12
0
def test_bad_venue_id():
    pyball = PyBall()
    with pytest.raises(InvalidIdError):
        pyball.get_venue(-1)
Ejemplo n.º 13
0
def test_get_not_implemented_draft_prospects():
    pyball = PyBall()
    with pytest.raises(NotImplementedError):
        pyball.get_draft_prospects()
Ejemplo n.º 14
0
def test_team_coaches():
    pyball = PyBall()
    return pyball.get_teams_coaches(114)
Ejemplo n.º 15
0
def test_positions():
    pyball = PyBall()
    return pyball.get_positions()
Ejemplo n.º 16
0
def test_game_status():
    pyball = PyBall()
    return pyball.get_game_status()
Ejemplo n.º 17
0
def test_get_season_by_id_took_too_long():
    pyball = PyBall()
    with pytest.raises(TookTooLongError):
        pyball._get("{0}/seasons/{1}".format(BASE_URL, "fall"))
Ejemplo n.º 18
0
def test_platform():
    pyball = PyBall()
    return pyball.get_platforms()
Ejemplo n.º 19
0
def test_get_season_by_id():
    pyball = PyBall()
    with pytest.raises(NotImplementedError):
        pyball.get_season_by_id("AnyValue")
Ejemplo n.º 20
0
def test_game_type():
    pyball = PyBall()
    return pyball.get_game_types()
Ejemplo n.º 21
0
def test_draft():
    pyball = PyBall()
    return pyball.get_draft_by_year(2017)
Ejemplo n.º 22
0
def test_languages():
    pyball = PyBall()
    return pyball.get_languages()
Ejemplo n.º 23
0
def test_latest_draft_pick():
    pyball = PyBall()
    return pyball.get_latest_draftee_by_year(2017)
Ejemplo n.º 24
0
def test_stats_type():
    pyball = PyBall()
    return pyball.get_stats_type()
Ejemplo n.º 25
0
def test_get_not_found_draft_prospects():
    pyball = PyBall()
    with pytest.raises(NotFound):
        pyball._get("{}/draft/prospects".format(BASE_URL))
Ejemplo n.º 26
0
def schedule_by_dates():
    pyball = PyBall()
    return pyball.get_schedule_by_id_dates(12, '2019-01-01', '2020-01-01')
Ejemplo n.º 27
0
def test_situation_codes():
    pyball = PyBall()
    return pyball.get_situation_codes()
Ejemplo n.º 28
0
def schedule_today():
    pyball = PyBall()
    return pyball.get_schedule_by_id_today(12)
Ejemplo n.º 29
0
def league():
    pyball = PyBall()
    league_id = pyball.get_teams()[0].league.id
    return pyball.get_league_by_id(league_id)
Ejemplo n.º 30
0
def test_divisions():
    pyball = PyBall()
    return pyball.get_divisions()