diff --git a/tests/testthat/test-KorAPConnection.R b/tests/testthat/test-KorAPConnection.R index 2f3d0db..a1efd9e 100644 --- a/tests/testthat/test-KorAPConnection.R +++ b/tests/testthat/test-KorAPConnection.R @@ -6,6 +6,10 @@ test_that("KorAPConnection fails gracefully on timeout", { expect_message(new("KorAPConnection", apiUrl="http://httpbin.org/delay/3", timeout = 1), "No internet|Timeout|json") }) +test_that("KorAPConnection fails gracefully on Bad Gateway errors", { + expect_message(new("KorAPConnection", apiUrl="http://httpbin.org/status/502", timeout = 1), "No internet|Timeout|json|502") +}) + test_that("KorAPConnection is printable", { kco <- new("KorAPConnection", timeout = 10) skip_if(is.null(kco@welcome))