Skip to content
This repository has been archived by the owner on Nov 10, 2024. It is now read-only.

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
llrs committed Jan 8, 2023
1 parent 5626d15 commit e4d1d79
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 29 deletions.
2 changes: 1 addition & 1 deletion tests/testthat/test-stream.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ test_that("stream_tweets returns tweets data", {
})


test_that("", {
test_that("Stream for 30 seconds", {
skip_if_offline()
if (!"RTAA" %in% auth_list()) {
skip("Requires different authentication")
Expand Down
28 changes: 0 additions & 28 deletions tests/testthat/test-tweet_threading.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,7 @@ test_that("tweet_threading works", {
tw <- lookup_tweets(thread[1])
tw_thread <- tweet_threading(tw)
expect_s3_class(tw_thread, "data.frame")
delete_thread(thread)
})



test_that("tweet_threading works fast", {
skip_if_offline()
thread <- write_thread()
tw <- lookup_tweets(thread)
tw_thread1 <- tweet_threading(tw[1, ])
expect_s3_class(tw_thread1, "data.frame")
Expand All @@ -54,14 +47,7 @@ test_that("tweet_threading works fast", {
expect_s3_class(tw_thread4, "data.frame")
expect_equal(order(tw_thread1$created_at)[1:4], 1:4)
expect_equal(order(tw_thread4$created_at)[1:4], 1:4)
delete_thread(thread)
})

test_that("tweet_threading works with id and tweets", {
skip_if_offline()
thread <- write_thread()

tw <- lookup_tweets(thread)
tw <- tw[match(thread, tw$id_str), ]

th1_id <- tweet_threading(thread[1], traverse = "backwards")
Expand All @@ -70,14 +56,7 @@ test_that("tweet_threading works with id and tweets", {
th10_id <- tweet_threading(thread[10], traverse = "backwards")
th10_tw <- tweet_threading(tw[10, ], traverse = "backwards")
expect_equal(nrow(th10_id), nrow(th10_tw))
delete_thread(thread)
})

test_that("tweet_threading works forwards", {
skip_if_offline()
thread <- write_thread()

tw <- lookup_tweets(thread)
tw <- tw[match(thread, tw$id_str), ]
th1_id <- tweet_threading(thread[1], traverse = "forwards")
expect_equal(nrow(th1_id), 10)
Expand All @@ -89,13 +68,6 @@ test_that("tweet_threading works forwards", {
th10_tw <- tweet_threading(tw[10, ], traverse = "forwards")
expect_equal(nrow(th10_id), nrow(th10_tw))

delete_thread(thread)
})

test_that("tweet_threading works forwards and backwards", {
skip_if_offline()
thread <- write_thread()

t1f <- tweet_threading(thread[1], traverse = "forwards")
expect_equal(nrow(t1f), 10)
t1b <- tweet_threading(thread[1], traverse = "backwards")
Expand Down

0 comments on commit e4d1d79

Please sign in to comment.