forked from sportsdataverse/hoopR
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest-load_nba_schedule.R
81 lines (77 loc) · 1.63 KB
/
test-load_nba_schedule.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
test_that("hoopR Loader NBA Schedule", {
skip_on_cran()
x <- load_nba_schedule(seasons = most_recent_nba_season())
cols <- c(
"id",
"uid",
"date",
"attendance",
"time_valid",
"neutral_site",
"conference_competition",
"recent",
"start_date",
"notes_type",
"notes_headline",
"type_id",
"type_abbreviation",
"venue_id",
"venue_full_name",
"venue_address_city",
"venue_capacity",
"venue_indoor",
"status_clock",
"status_display_clock",
"status_period",
"status_type_id",
"status_type_name",
"status_type_state",
"status_type_completed",
"status_type_description",
"status_type_detail",
"status_type_short_detail",
"format_regulation_periods",
"home_id",
"home_uid",
"home_location",
"home_name",
"home_abbreviation",
"home_display_name",
"home_short_display_name",
"home_color",
"home_alternate_color",
"home_is_active",
"home_venue_id",
"home_logo",
"home_score",
"home_winner",
"away_id",
"away_uid",
"away_location",
"away_name",
"away_abbreviation",
"away_display_name",
"away_short_display_name",
"away_color",
"away_alternate_color",
"away_is_active",
"away_venue_id",
"away_logo",
"away_score",
"away_winner",
"game_id",
"season",
"season_type",
"venue_address_state",
"status_type_alt_detail",
"game_json",
"game_json_url",
"game_date_time",
"game_date",
"PBP",
"team_box",
"player_box"
)
expect_equal(sort(colnames(x)), sort(cols))
expect_s3_class(x, "data.frame")
})