Skip to content
This repository has been archived by the owner on Feb 4, 2022. It is now read-only.

Commit

Permalink
make damn sure authorization NOT in place for tests of data consumpti…
Browse files Browse the repository at this point in the history
…on with public visibility
  • Loading branch information
jennybc committed May 27, 2015
1 parent e7f0c25 commit 10bfcbb
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/testthat/test-yy-axe-oauth-token.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
context("revoke authentication")

## remove the google token, to make 100% sure the remaining tests run w/o auth

## this filename is deliberate w/r/t alphabetical order, so don't change it
## lightly! it's no coincidence that "axe" starts with "A"
gs_auth_revoke(rm_httr_oauth = TRUE, verbose = FALSE)

test_that("Token does NOT exist, no .httr-oauth file in wd", {

expect_false(token_exists())
expect_false(file.exists(".httr-oauth"))

})

test_that("We can NOT register a pvt sheet owned by rpackagetest", {

if(interactive()) {
mess <- paste("Skipping the attempt to access private third party",
"sheet w/o authorization, because session is interactive",
"and would launch browser-based authentication.")
skip(mess)
}
expect_error(gs_ws_feed(cars_pvt_ws_feed, lookup = FALSE, verbose = FALSE))

})
8 changes: 8 additions & 0 deletions tests/testthat/test-zz-clean-up.R
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
## re-authenticate!
gs_auth(token = "googlesheets_token.rds")

## "RAIN DANCE"
## RELIABLY FORCES AUTO-REFRESH OF STALE OAUTH TOKEN
## I DON'T KNOW WHY THIS HELPS BUT IT DOES!
gs_ls()

gs_grepdel(TEST, verbose = FALSE)

0 comments on commit 10bfcbb

Please sign in to comment.