示例#1
0
def test_single_game_request() -> None:
    result = statcast_single_game(289317)

    assert result is not None
    assert not result.empty

    assert len(result.columns) == 89
    assert len(result) == 462
示例#2
0
def test_single_game_request() -> None:
    result = statcast_single_game(289317)

    assert result is not None
    assert not result.empty

    assert len(result.columns) == CURRENT_SC_COLUMNS
    assert len(result) > 0
示例#3
0
def test_statcast_single_game_request(response_get_monkeypatch: Callable,
                                      single_game_raw: str,
                                      single_game: pd.DataFrame) -> None:
    game_pk = '631614'

    response_get_monkeypatch(single_game_raw.encode('UTF-8'),
                             _SC_SINGLE_GAME_REQUEST.format(game_pk=game_pk))

    statcast_result = statcast_single_game(game_pk).reset_index(drop=True)

    pd.testing.assert_frame_equal(statcast_result,
                                  single_game,
                                  check_dtype=False)