This repository has been archived by the owner on Feb 4, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 191
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make damn sure authorization NOT in place for tests of data consumpti…
…on with public visibility
- Loading branch information
jennybc
committed
May 27, 2015
1 parent
e7f0c25
commit 10bfcbb
Showing
2 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) | ||
|
||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |