Package: httptest 4.2.2.9000

httptest: A Test Environment for HTTP Requests

Testing and documenting code that communicates with remote servers can be painful. Dealing with authentication, server state, and other complications can make testing seem too costly to bother with. But it doesn't need to be that hard. This package enables one to test all of the logic on the R sides of the API in your package without requiring access to the remote service. Importantly, it provides three contexts that mock the network connection in different ways, as well as testing functions to assert that HTTP requests were---or were not---made. It also allows one to safely record real API responses to use as test fixtures. The ability to save responses and load them offline also enables one to write vignettes and other dynamic documents that can be distributed without access to a live server.

Authors:Neal Richardson [aut, cre], Jonathan Keane [ctb], Maëlle Salmon [ctb]

httptest_4.2.2.9000.tar.gz
httptest_4.2.2.9000.zip(r-4.5)httptest_4.2.2.9000.zip(r-4.4)httptest_4.2.2.9000.zip(r-4.3)
httptest_4.2.2.9000.tgz(r-4.4-any)httptest_4.2.2.9000.tgz(r-4.3-any)
httptest_4.2.2.9000.tar.gz(r-4.5-noble)httptest_4.2.2.9000.tar.gz(r-4.4-noble)
httptest_4.2.2.9000.tgz(r-4.4-emscripten)httptest_4.2.2.9000.tgz(r-4.3-emscripten)
httptest.pdf |httptest.html
httptest/json (API)
NEWS

# Install 'httptest' in R:
install.packages('httptest', repos = c('https://nealrichardson.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/nealrichardson/httptest/issues

On CRAN:

httpmocktest-framework

9.31 score 79 stars 1 packages 274 scripts 1.6k downloads 40 exports 37 dependencies

Last updated 10 months agofrom:5b8b14bf10. Checks:OK: 7. Indexed: yes.

TargetResultDate
Doc / VignettesOKOct 25 2024
R-4.5-winOKOct 25 2024
R-4.5-linuxOKOct 25 2024
R-4.4-winOKOct 25 2024
R-4.4-macOKOct 25 2024
R-4.3-winOKOct 25 2024
R-4.3-macOKOct 25 2024

Exports:.mockPathsblock_requestsbuild_mock_urlcapture_requestschange_stateend_vignetteexpect_DELETEexpect_GETexpect_headerexpect_json_equivalentexpect_no_requestexpect_PATCHexpect_POSTexpect_PUTfake_responsefind_mock_fileget_current_redactorget_current_requestergsub_requestgsub_responsepublicredact_authredact_cookiesredact_headerssave_responseset_redactorset_requesterskip_if_disconnectedstart_capturingstart_vignettestop_capturingstop_mockinguse_httptestuse_mock_apiwith_fake_httpwith_mock_apiwith_mock_dirwith_tracewithin_body_textwithout_internet

Dependencies:askpassbriocallrclicrayoncurldescdiffobjdigestevaluatefansifsgluehttrjsonlitelifecyclemagrittrmimeopensslpillarpkgbuildpkgconfigpkgloadpraiseprocessxpsR6rematch2rlangrprojrootsystestthattibbleutf8vctrswaldowithr

Frequently Asked Questions

Rendered fromfaq.Rmdusingknitr::rmarkdownon Oct 25 2024.

Last update: 2020-12-15
Started: 2020-12-15

httptest: A Test Environment for HTTP Requests in R

Rendered fromhttptest.Rmdusingknitr::rmarkdownon Oct 25 2024.

Last update: 2021-01-31
Started: 2017-06-01

Redacting and Modifying Recorded Requests

Rendered fromredacting.Rmdusingknitr::rmarkdownon Oct 25 2024.

Last update: 2021-01-31
Started: 2017-10-08

Writing Vignettes with APIs

Rendered fromvignettes.Rmdusingknitr::rmarkdownon Oct 25 2024.

Last update: 2021-01-31
Started: 2018-01-12