etsyReference <- environment()
load("resources/etsyReference.RData", envir = etsyReference)
basicSanityCheck <- function(methodName, expectedColumns = NULL, ...){
test_that(methodName, {
df <- eGET(methodName, ...)
expect(is.data.frame(df), sprintf("%s did not return a data.frame", methodName))
expect(nrow(df) > 0, sprintf("%s returned emtpy", methodName))
if (!is.null(expectedColumns)) {
expect(
setequal(colnames(df), expectedColumns),
sprintf("Mismatch in columns of %s response", methodName)
)
}
})
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.