-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
169 additions
and
65 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
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
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
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 @@ | ||
|
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,104 @@ | ||
# cli_alert_warning works [plain] | ||
|
||
Code | ||
cli::cli_alert_warning( | ||
"This package hasn't been tested with this Bugzilla version.") | ||
Message <cliMessage> | ||
! This package hasn't been tested with this Bugzilla version. | ||
|
||
# cli_alert_warning works [ansi] | ||
|
||
Code | ||
cli::cli_alert_warning( | ||
"This package hasn't been tested with this Bugzilla version.") | ||
Message <cliMessage> | ||
[33m![39m This package hasn't been tested with this Bugzilla version. | ||
|
||
# cli_alert_warning works [unicode] | ||
|
||
Code | ||
cli::cli_alert_warning( | ||
"This package hasn't been tested with this Bugzilla version.") | ||
Message <cliMessage> | ||
! This package hasn't been tested with this Bugzilla version. | ||
|
||
# cli_alert_warning works [fancy] | ||
|
||
Code | ||
cli::cli_alert_warning( | ||
"This package hasn't been tested with this Bugzilla version.") | ||
Message <cliMessage> | ||
[33m![39m This package hasn't been tested with this Bugzilla version. | ||
|
||
# cli_alert_danger [plain] | ||
|
||
Code | ||
cli::cli_alert_danger("Not authenticated on this site.") | ||
Message <cliMessage> | ||
x Not authenticated on this site. | ||
Code | ||
cli::cli_alert_success("Authenticated on this site!") | ||
Message <cliMessage> | ||
v Authenticated on this site! | ||
|
||
# cli_alert_danger [ansi] | ||
|
||
Code | ||
cli::cli_alert_danger("Not authenticated on this site.") | ||
Message <cliMessage> | ||
[31mx[39m Not authenticated on this site. | ||
Code | ||
cli::cli_alert_success("Authenticated on this site!") | ||
Message <cliMessage> | ||
[32mv[39m Authenticated on this site! | ||
|
||
# cli_alert_danger [unicode] | ||
|
||
Code | ||
cli::cli_alert_danger("Not authenticated on this site.") | ||
Message <cliMessage> | ||
✖ Not authenticated on this site. | ||
Code | ||
cli::cli_alert_success("Authenticated on this site!") | ||
Message <cliMessage> | ||
✔ Authenticated on this site! | ||
|
||
# cli_alert_danger [fancy] | ||
|
||
Code | ||
cli::cli_alert_danger("Not authenticated on this site.") | ||
Message <cliMessage> | ||
[31m✖[39m Not authenticated on this site. | ||
Code | ||
cli::cli_alert_success("Authenticated on this site!") | ||
Message <cliMessage> | ||
[32m✔[39m Authenticated on this site! | ||
|
||
# cli_alert_dangers [plain] | ||
|
||
Code | ||
cli::cli_alert_danger("Key not valid or not set.") | ||
Message <cliMessage> | ||
x Key not valid or not set. | ||
|
||
# cli_alert_dangers [ansi] | ||
|
||
Code | ||
cli::cli_alert_danger("Key not valid or not set.") | ||
Message <cliMessage> | ||
[31mx[39m Key not valid or not set. | ||
|
||
# cli_alert_dangers [unicode] | ||
|
||
Code | ||
cli::cli_alert_danger("Key not valid or not set.") | ||
Message <cliMessage> | ||
✖ Key not valid or not set. | ||
|
||
# cli_alert_dangers [fancy] | ||
|
||
Code | ||
cli::cli_alert_danger("Key not valid or not set.") | ||
Message <cliMessage> | ||
[31m✖[39m Key not valid or not set. | ||
|
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
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,59 @@ | ||
test_that("create_bugzilla_key works", { | ||
vcr::use_cassette("create_bugzilla_key", { | ||
cbk <- create_bugzilla_key(missing_host()) | ||
url <- "https://bugs.r-project.org/bugzilla/userprefs.cgi?tab=apikey" | ||
}) | ||
expect_equal(paste0(missing_host(), "userprefs.cgi?tab=apikey"), url) | ||
expect_condition() | ||
cli::test_that_cli("cli_alert_warning works", { | ||
expect_snapshot({ | ||
cli::cli_alert_warning("This package hasn't been tested with this Bugzilla version.") | ||
}) | ||
}) | ||
}) | ||
|
||
|
||
test_that("check_authentication works", { | ||
vcr::use_cassette("check_authentication", { | ||
ca <- check_authentication(missing_host()) | ||
}) | ||
expect_equal(missing_host(), "https://bugs.r-project.org/bugzilla/") | ||
cli::test_that_cli("cli_alert_danger",{ | ||
expect_snapshot({ | ||
cli::cli_alert_danger("Not authenticated on this site.") | ||
cli::cli_alert_success("Authenticated on this site!") | ||
}) | ||
}) | ||
}) | ||
|
||
|
||
test_that("check_api_version works", { | ||
vcr::use_cassette("check_api_version", { | ||
cav <- check_api_version(missing_host()) | ||
}) | ||
expect_equal(missing_host(), "https://bugs.r-project.org/bugzilla/") | ||
}) | ||
|
||
|
||
test_that("check_last_audit works", { | ||
vcr::use_cassette("check_last_audit", { | ||
cla <- check_last_audit(missing_product(), missing_host()) | ||
}) | ||
expect_equal(missing_host(), "https://bugs.r-project.org/bugzilla/") | ||
expect_equal(missing_product(), "R") | ||
expect_s3_class(GET(paste0(missing_host(), "rest/last_audit_time")), "response") | ||
}) | ||
|
||
|
||
test_that("valid_key works", { | ||
use_cassette("valid_key", { | ||
vk <- valid_key(use_key()) | ||
}) | ||
cli::test_that_cli("cli_alert_dangers", { | ||
expect_snapshot({ | ||
cli::cli_alert_danger("Key not valid or not set.") | ||
}) | ||
}) | ||
}) | ||
|
||
snapshot_accept('R/api.R') |