tests/testthat/test-espn_wbb_game_rosters.R

test_that("ESPN - WBB Play-by-Play", {
  skip_on_cran()
  x <- espn_wbb_game_rosters(game_id = 401276115)
  
  cols <- c(
    "athlete_id",
    "athlete_uid",
    "athlete_guid",
    "athlete_type",
    "sdr",
    "first_name",
    "last_name",
    "full_name",
    "athlete_display_name",
    "short_name",
    "height",
    "display_height",
    "birth_place_city",
    "birth_place_state",
    "birth_place_country",
    "slug",
    "headshot_href",
    "headshot_alt",
    "jersey",
    "position_id",
    "position_name",
    "position_display_name",
    "position_abbreviation",
    "position_leaf",
    "linked",
    "experience_years",
    "experience_display_value",
    "experience_abbreviation",
    "active",
    "status_id",
    "status_name",
    "status_type",
    "status_abbreviation",
    "starter",
    "valid",
    "did_not_play",
    "display_name",
    "ejected",
    "team_id",
    "team_guid",
    "team_uid",
    "team_sdr",
    "team_slug",
    "team_location",
    "team_name",
    "team_nickname",
    "team_abbreviation",
    "team_display_name",
    "team_short_display_name",
    "team_color",
    "team_alternate_color",
    "is_active",
    "is_all_star",
    "logo_href",
    "logo_dark_href",
    "game_id",
    "order",
    "home_away",
    "winner",
    "roster_href",
    "hand_type",
    "hand_abbreviation",
    "hand_display_value",
    "age",
    "date_of_birth",
    "weight",
    "display_weight"
  )
  
  expect_in(sort(cols), sort(colnames(x)))
  expect_s3_class(x, "data.frame")
})

Try the wehoop package in your browser

Any scripts or data that you put into this service are public.

wehoop documentation built on Nov. 26, 2023, 1:08 a.m.