summaryrefslogtreecommitdiffstats
path: root/tests/test-config.R
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test-config.R')
-rw-r--r--tests/test-config.R27
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")
+)