Skip to content

Commit

Permalink
test fix2
Browse files Browse the repository at this point in the history
  • Loading branch information
M-Kusumgar committed Feb 8, 2024
1 parent f42780d commit c779006
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/testthat/test-zzz-location-http.R
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,15 @@ describe("http location integration tests", {
root_tmp <- create_temporary_root(use_file_store = TRUE)
id_tmp <- create_random_packet(root_tmp)

hash_bad <- hash_data("", "sha256")
hash <- root_tmp$index$metadata(id_tmp)$files$hash
meta <- read_string(
file.path(root_tmp$path, ".outpack", "metadata", id_tmp))

orderly_location_http$new(url)$push_file(find_file_by_hash(root_tmp, hash), hash)

## Trigger the error directly:
cl <- outpack_http_client$new(url)
err <- expect_error(cl$post(sprintf("/packet/%s", hash_bad), meta,
err <- expect_error(cl$post(sprintf("/packet/%s", hash), meta,
httr::content_type("text/plain")),
"Expected hash '.+' but found '.+'")
})
Expand Down

0 comments on commit c779006

Please sign in to comment.