Skip to content

Commit

Permalink
disable http tests (when https is required)
Browse files Browse the repository at this point in the history
close #396
  • Loading branch information
wibeasley committed Jul 19, 2022
1 parent b8b0f50 commit 1e97690
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Description: Encapsulates functions to streamline calls from R to the REDCap
University. The Application Programming Interface (API) offers an avenue
to access and modify data programmatically, improving the capacity for
literate and reproducible programming.
Version: 1.0.9001
Version: 1.0.9002
Authors@R: c(person("Will", "Beasley", role = c("aut", "cre"), email =
"[email protected]", comment = c(ORCID = "0000-0002-5613-5006")),
person("David", "Bard", role = "ctb"),
Expand Down
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ Upcoming Versions
* `retrieve_credential_local()` can now user `username` to identify the desired credential row (#364)
* `redcap_read()` and `redcap_read_oneshot()` gain the `http_response_encoding` parameter that's passed to [`httr::content()`](https://httr.r-lib.org/reference/content.html). The default value remains "UTF-8". (#354, @lrasmus)
* Accommodate single-character REDCap variable names (#367 & #368, @daynefiler)
* Modify `redcap_users_export()` (which calls REDCap's user export). The API dropped the `data_export` variable and added the `forms_export` variable. (#396)
* For `redcap_read_oneshot_eav()`: if the project isn't longitudinal, a dummy value for `event_id` is used internally (#396)
* For the testing server & projects, the http errors are a little different, so the testing code was adjusted (#396)
* Set `httr::user_agent`, following the advice of its vignette (#397)

### Test Suite
Expand Down
2 changes: 2 additions & 0 deletions tests/testthat/test-read-errors.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ credential <- retrieve_credential_testing()

test_that("One Shot: Bad Uri -Not HTTPS", {
testthat::skip_on_cran()
testthat::skip("The response is dependent on the client. This test is probably too picky anyway.")
# expected_message_411 <- "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\"\"http://www.w3.org/TR/html4/strict.dtd\">\n<HTML><HEAD><TITLE>Length Required</TITLE>\n<META HTTP-EQUIV=\"Content-Type\" Content=\"text/html; charset=us-ascii\"></HEAD>\n<BODY><h2>Length Required</h2>\n<hr><p>HTTP Error 411. The request must be chunked or have a content length.</p>\n</BODY></HTML>\n"
# expected_message_501 <- "<?xml version=\"1.0\" encoding=\"UTF-8\" ?><hash><error>The requested method is not implemented.</error></hash>"

Expand Down Expand Up @@ -50,6 +51,7 @@ test_that("One Shot: Bad Uri -wrong address", {

test_that("Batch: Bad Uri -Not HTTPS", {
testthat::skip_on_cran()
testthat::skip("The response is dependent on the client. This test is probably too picky anyway.")
# expected_outcome_message <- "The initial call failed with the code: (411|501)."

expect_error(
Expand Down

0 comments on commit 1e97690

Please sign in to comment.