Skip to content

Commit

Permalink
Explicitely test that Bad Gateway errors result in graceful fails
Browse files Browse the repository at this point in the history
Change-Id: I267fceca9e5b2ce64e01291842f3d587624bc3ac
  • Loading branch information
kupietz committed Apr 18, 2023
1 parent 9cdb4be commit f650629
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/testthat/test-KorAPConnection.R
Expand Up @@ -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))
Expand Down

0 comments on commit f650629

Please sign in to comment.