tests/testthat/test_youtube.R

source("cred.R")
require(magrittr)

## "4_hHKlEZ9Go" is a closed comment video

test_that("Youtube Empty Comment Error",{
    expect_error(Authenticate("youtube", yt) %>% Collect(videoIDs = c("4_hHKlEZ9Go")), "No comment can be collected from the given videoIDs.")
### however, multiple videoIDs with only one with empty comment should not throw an error.
    borat <- Authenticate("youtube", yt) %>% Collect(videoIDs = c("4_hHKlEZ9Go", "YzdYF0r3gB4"))
    expect_true("dataSource" %in% class(borat))
})

Try the SocialMediaLab package in your browser

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

SocialMediaLab documentation built on May 29, 2017, 9:41 p.m.