Debian Codegraph @

tests/testthat/test-upload.R

raw
1 test_that("File upload", {
2 file <- system.file('DESCRIPTION', package = 'curl')
3 res <- curl_upload(file, httpbin('/anything'), verbose = FALSE)
4 data <- jsonlite::parse_json(rawToChar(res$content))$data
5 input <- rawToChar(readBin(file, raw(), file.info(file)$size))
6 expect_identical(data, input)
7 })