tests/testthat/test_get_friends.R

context("get_friends")

test_that("get_friends returns data frame with ids", {
    skip_on_cran()

    token <- readRDS("twitter_tokens")
    rl <- rate_limit(token, "get_followers")
    if (rl$remaining > 1) {
        f <- get_friends("kearneymw", token = token)
    
        expect_true(is.data.frame(f))
        ##expect_true(is.character(f[["ids"]]))
        expect_gt(nrow(f), 200)
    } else {
        expect_true(rl$limit == 15)
        expect_true(rl$remaining == 0)
        expect_true(rl$limit == 15)
        expect_true(rl$limit == 15)
    }
})

Try the rtweet package in your browser

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

rtweet documentation built on Jan. 11, 2020, 9:11 a.m.