Nothing
# Tests ---------------------------------------------------------
testthat::test_that('gc_play_by_plays_raw() returns the stored raw parquet without padding situationCode', {
src <- tempfile(fileext = '.parquet')
raw_pbp <- data.frame(
gameId = 202120220001,
eventId = 1L,
situationCode = '651',
stringsAsFactors = FALSE
)
arrow::write_parquet(raw_pbp, src)
testthat::local_mocked_bindings(
download.file = function(url, destfile, mode = 'wb', quiet = TRUE, ...) {
testthat::expect_true(grepl('NHL_PBPS_GC_(Raw_)?20212022\\.parquet$', url))
testthat::expect_true(file.copy(src, destfile, overwrite = TRUE))
0L
},
.package = 'utils'
)
raw_out <- gc_play_by_plays_raw(20212022)
clean_out <- gc_play_by_plays(20212022)
testthat::expect_equal(raw_out$situationCode, '651')
testthat::expect_equal(clean_out$situationCode, '0651')
})
# Run load pbp raw tests.
testthat::test_that('wsc_play_by_plays_raw() returns the stored raw parquet without padding situationCode', {
src <- tempfile(fileext = '.parquet')
raw_pbp <- data.frame(
gameId = 202120220001,
eventId = 1L,
situationCode = '551',
stringsAsFactors = FALSE
)
arrow::write_parquet(raw_pbp, src)
testthat::local_mocked_bindings(
download.file = function(url, destfile, mode = 'wb', quiet = TRUE, ...) {
testthat::expect_true(grepl('NHL_PBPS_WSC_(Raw_)?20212022\\.parquet$', url))
testthat::expect_true(file.copy(src, destfile, overwrite = TRUE))
0L
},
.package = 'utils'
)
raw_out <- wsc_play_by_plays_raw(20212022)
clean_out <- wsc_play_by_plays(20212022)
testthat::expect_equal(raw_out$situationCode, '551')
testthat::expect_equal(clean_out$situationCode, '0551')
})
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.