diff options
| author | Murilo Ijanc <[email protected]> | 2026-07-26 12:42:37 -0300 |
|---|---|---|
| committer | Murilo Ijanc <[email protected]> | 2026-07-26 12:42:37 -0300 |
| commit | 11d49bc25eb1643f1b742f9527212d8781f2e0de (patch) | |
| tree | bae1cb090cbf6c9f82ab5abbaf1194206f92f539 /tests/test-config.R | |
| download | r-11d49bc25eb1643f1b742f9527212d8781f2e0de.tar.gz | |
Initial importv0.1.0
Diffstat (limited to 'tests/test-config.R')
| -rw-r--r-- | tests/test-config.R | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/test-config.R b/tests/test-config.R new file mode 100644 index 0000000..57e3b3b --- /dev/null +++ b/tests/test-config.R @@ -0,0 +1,27 @@ +library(cepis) +source(file.path("helper", "utils.R")) + +check( + "a trailing slash is stripped from base_url", + identical(cepis_client(base_url = "http://x/")$base_url, "http://x") +) +check( + "the user agent identifies the library", + grepl("cepis-r/", cepis_client()$user_agent, fixed = TRUE) +) +check( + "max_attempts below one is rejected", + inherits(caught(cepis_client(max_attempts = 0L)), "error") +) +check( + "a timeout of zero is rejected", + inherits(caught(cepis_client(timeout = 0)), "error") +) +check( + "a total_timeout of zero is rejected", + inherits(caught(cepis_client(total_timeout = 0)), "error") +) +check( + "the default base_url is the public API", + identical(cepis_client()$base_url, "https://cep.is") +) |