Skip to content

Commit

Permalink
Add test for result path error case
Browse files Browse the repository at this point in the history
  • Loading branch information
r-ash committed Apr 8, 2024
1 parent 1cb8aaa commit 5fbf9d5
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/testthat/test-01-endpoints-download.R
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,17 @@ test_that("download result returns formatted error if unexpected issue", {
expect_equal(error$data[[1]]$detail, scalar("Missing result for task: '1'"))
})

test_that("download result path returns formatted error if unexpected issue", {
queue <- MockQueue$new(workers = 0)
download <- download_result_path(queue)
error <- expect_error(download("1"))

expect_equal(error$status_code, 400)
expect_equal(names(error$data[[1]]), c("error", "detail", "key"))
expect_equal(error$data[[1]]$error, scalar("FAILED_TO_RETRIEVE_RESULT"))
expect_equal(error$data[[1]]$detail, scalar("Missing result for task: '1'"))
})

test_that("download submit returns error if queueing fails", {
test_redis_available()
## Create mocks
Expand Down

0 comments on commit 5fbf9d5

Please sign in to comment.