Running ‘testthat.R’ [3s/9s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > "dwapi-r
  + Copyright 2017 data.world, Inc.
  + 
  + Licensed under the Apache License, Version 2.0 (the \"License\");
  + you may not use this file except in compliance with the License.
  + 
  + You may obtain a copy of the License at
  + http://www.apache.org/licenses/LICENSE-2.0
  + 
  + Unless required by applicable law or agreed to in writing, software
  + distributed under the License is distributed on an \"AS IS\" BASIS,
  + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
  + implied. See the License for the specific language governing
  + permissions and limitations under the License.
  + 
  + This product includes software developed at data.world, Inc.
  + https://data.world"
  [1] "dwapi-r\nCopyright 2017 data.world, Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\n\nYou may obtain a copy of the License at\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\nimplied. See the License for the specific language governing\npermissions and limitations under the License.\n\nThis product includes software developed at data.world, Inc.\nhttps://data.world"
  > 
  > library(testthat)
  > library(dwapi)
  > 
  > test_check("dwapi")
  ── 1. Error: get_table_as_dataframe making the correct HTTR request (@test_downl
  cannot open the connection
  1: with_mock(`httr::GET` = function(url, header, progress, user_agent) {
         expect_equal(url, sprintf("https://query.data.world/tables/ownerid/datasetid/tableid/rows", 
             dataset))
         expect_equal(header$headers[["Authorization"]], "Bearer API_TOKEN")
         expect_equal(user_agent$options$useragent, user_agent())
         return(success_message_response_with_content(mock_response_local_content_path, 
             "application/csv"))
     }, `mime::guess_type` = function(...) NULL, dwapi::download_table_as_data_frame(dataset = dataset, 
         table_name = "tableid")) at testthat/test_download_table_as_data_frame.R:22
  2: extract_mocks(new_values = new_values[!code_pos], .env = .env, eval_env = parent.frame())
  3: lapply(stats::setNames(nm = mock_qual_names), function(qual_name) {
         pkg_name <- gsub(pkg_and_name_rx, "\\1", qual_name)
         if (is_base_pkg(pkg_name)) {
             stop("Can't mock functions in base packages (", pkg_name, ")", call. = FALSE)
         }
         name <- gsub(pkg_and_name_rx, "\\2", qual_name)
         if (pkg_name == "") 
             pkg_name <- .env
         env <- asNamespace(pkg_name)
         if (!exists(name, envir = env, mode = "function")) 
             stop("Function ", name, " not found in environment ", environmentName(env), 
                 ".", call. = FALSE)
         mock(name = name, env = env, new = eval(new_values[[qual_name]], eval_env, eval_env))
     })
  4: FUN(X[[i]], ...)
  5: is_base_pkg(pkg_name)
  6: x %in% rownames(utils::installed.packages(priority = "base"))
  7: rownames(utils::installed.packages(priority = "base"))
  8: utils::installed.packages(priority = "base")
  9: saveRDS(list(base = base, value = ret0), dest)
  10: gzfile(file, mode)
  
  ── 2. Error: getDataset making the correct HTTR request (@test_get_dataset.R#20)
  cannot open the connection
  1: with_mock(`httr::GET` = function(url, header, user_agent) {
         expect_equal(url, "https://api.data.world/v0/datasets/ownerid/datasetid")
         expect_equal(header$headers[["Authorization"]], "Bearer API_TOKEN")
         expect_equal(user_agent$options$useragent, user_agent())
         return(success_message_response_with_content("resources/api.data.world/v0/DatasetSummaryResponse.sample.json", 
             "application/json"))
     }, `mime::guess_type` = function(...) NULL, dwapi::get_dataset("ownerid/datasetid")) at testthat/test_get_dataset.R:20
  2: extract_mocks(new_values = new_values[!code_pos], .env = .env, eval_env = parent.frame())
  3: lapply(stats::setNames(nm = mock_qual_names), function(qual_name) {
         pkg_name <- gsub(pkg_and_name_rx, "\\1", qual_name)
         if (is_base_pkg(pkg_name)) {
             stop("Can't mock functions in base packages (", pkg_name, ")", call. = FALSE)
         }
         name <- gsub(pkg_and_name_rx, "\\2", qual_name)
         if (pkg_name == "") 
             pkg_name <- .env
         env <- asNamespace(pkg_name)
         if (!exists(name, envir = env, mode = "function")) 
             stop("Function ", name, " not found in environment ", environmentName(env), 
                 ".", call. = FALSE)
         mock(name = name, env = env, new = eval(new_values[[qual_name]], eval_env, eval_env))
     })
  4: FUN(X[[i]], ...)
  5: is_base_pkg(pkg_name)
  6: x %in% rownames(utils::installed.packages(priority = "base"))
  7: rownames(utils::installed.packages(priority = "base"))
  8: utils::installed.packages(priority = "base")
  9: saveRDS(list(base = base, value = ret0), dest)
  10: gzfile(file, mode)
  
  ── 3. Error: get_table_schema making the correct HTTR request (@test_get_table_s
  cannot open the connection
  1: with_mock(`httr::GET` = function(url, header, user_agent) {
         expect_equal(url, "https://query.data.world/tables/ownerid/datasetid/tableid/schema")
         expect_equal(header$headers[["Authorization"]], "Bearer API_TOKEN")
         expect_equal(user_agent$options$useragent, user_agent())
         return(success_message_response_with_content("resources/query.data.world/Schema.sample.json", 
             "application/json"))
     }, `mime::guess_type` = function(...) NULL, dwapi::get_table_schema("ownerid/datasetid", 
         "tableid")) at testthat/test_get_table_schema.R:20
  2: extract_mocks(new_values = new_values[!code_pos], .env = .env, eval_env = parent.frame())
  3: lapply(stats::setNames(nm = mock_qual_names), function(qual_name) {
         pkg_name <- gsub(pkg_and_name_rx, "\\1", qual_name)
         if (is_base_pkg(pkg_name)) {
             stop("Can't mock functions in base packages (", pkg_name, ")", call. = FALSE)
         }
         name <- gsub(pkg_and_name_rx, "\\2", qual_name)
         if (pkg_name == "") 
             pkg_name <- .env
         env <- asNamespace(pkg_name)
         if (!exists(name, envir = env, mode = "function")) 
             stop("Function ", name, " not found in environment ", environmentName(env), 
                 ".", call. = FALSE)
         mock(name = name, env = env, new = eval(new_values[[qual_name]], eval_env, eval_env))
     })
  4: FUN(X[[i]], ...)
  5: is_base_pkg(pkg_name)
  6: x %in% rownames(utils::installed.packages(priority = "base"))
  7: rownames(utils::installed.packages(priority = "base"))
  8: utils::installed.packages(priority = "base")
  9: saveRDS(list(base = base, value = ret0), dest)
  10: gzfile(file, mode)
  
  ── 4. Error: list_tables making the correct HTTR request (@test_list_tables.R#20
  cannot open the connection
  1: with_mock(`httr::GET` = function(url, header, user_agent) {
         expect_equal(url, "https://query.data.world/tables/ownerid/datasetid")
         expect_equal(header$headers[["Authorization"]], "Bearer API_TOKEN")
         expect_equal(user_agent$options$useragent, user_agent())
         return(structure(list(status_code = 200, content = charToRaw("[\"table1\", \"table2\"]"), 
             headers = list("Content-Type", "application/json")), class = "response"))
     }, `mime::guess_type` = function(...) NULL, dwapi::list_tables("ownerid/datasetid")) at testthat/test_list_tables.R:20
  2: extract_mocks(new_values = new_values[!code_pos], .env = .env, eval_env = parent.frame())
  3: lapply(stats::setNames(nm = mock_qual_names), function(qual_name) {
         pkg_name <- gsub(pkg_and_name_rx, "\\1", qual_name)
         if (is_base_pkg(pkg_name)) {
             stop("Can't mock functions in base packages (", pkg_name, ")", call. = FALSE)
         }
         name <- gsub(pkg_and_name_rx, "\\2", qual_name)
         if (pkg_name == "") 
             pkg_name <- .env
         env <- asNamespace(pkg_name)
         if (!exists(name, envir = env, mode = "function")) 
             stop("Function ", name, " not found in environment ", environmentName(env), 
                 ".", call. = FALSE)
         mock(name = name, env = env, new = eval(new_values[[qual_name]], eval_env, eval_env))
     })
  4: FUN(X[[i]], ...)
  5: is_base_pkg(pkg_name)
  6: x %in% rownames(utils::installed.packages(priority = "base"))
  7: rownames(utils::installed.packages(priority = "base"))
  8: utils::installed.packages(priority = "base")
  9: saveRDS(list(base = base, value = ret0), dest)
  10: gzfile(file, mode)
  
  ── 5. Error: replaceDataset making the correct HTTR request (@test_replace_datas
  cannot open the connection
  1: with_mock(`httr::PUT` = function(url, body, header, user_agent) {
         expect_equal(url, "https://api.data.world/v0/datasets/ownerid/datasetid")
         expect_equal(header$headers[["Authorization"]], "Bearer API_TOKEN")
         expect_equal(body, rjson::toJSON(request))
         expect_equal(user_agent$options$useragent, user_agent())
         return(success_message_response())
     }, `mime::guess_type` = function(...) NULL, dwapi::replace_dataset("ownerid/datasetid", 
         dataset_replace_req = request)) at testthat/test_replace_dataset.R:23
  2: extract_mocks(new_values = new_values[!code_pos], .env = .env, eval_env = parent.frame())
  3: lapply(stats::setNames(nm = mock_qual_names), function(qual_name) {
         pkg_name <- gsub(pkg_and_name_rx, "\\1", qual_name)
         if (is_base_pkg(pkg_name)) {
             stop("Can't mock functions in base packages (", pkg_name, ")", call. = FALSE)
         }
         name <- gsub(pkg_and_name_rx, "\\2", qual_name)
         if (pkg_name == "") 
             pkg_name <- .env
         env <- asNamespace(pkg_name)
         if (!exists(name, envir = env, mode = "function")) 
             stop("Function ", name, " not found in environment ", environmentName(env), 
                 ".", call. = FALSE)
         mock(name = name, env = env, new = eval(new_values[[qual_name]], eval_env, eval_env))
     })
  4: FUN(X[[i]], ...)
  5: is_base_pkg(pkg_name)
  6: x %in% rownames(utils::installed.packages(priority = "base"))
  7: rownames(utils::installed.packages(priority = "base"))
  8: utils::installed.packages(priority = "base")
  9: saveRDS(list(base = base, value = ret0), dest)
  10: gzfile(file, mode)
  
  ── 6. Error: SPARQL query making the correct HTTR request (@test_sparql.R#30)  ─
  cannot open the connection
  1: with_mock(`httr::GET` = function(url, query, header, user_agent) {
         expect_equal(url, sprintf("https://query.data.world/sparql/%s", dataset))
         expect_equal(header$headers[["Authorization"]], "Bearer API_TOKEN")
         expect_equal(header$headers[["Accept"]], "text/csv")
         expect_equal(query[["query"]], sql_query)
         expect_equal(query[["parameters"]], "key1=\"value1\",?key2=\"1\"^^<http://www.w3.org/2001/XMLSchema#integer>,?key3=\"1\"^^<http://www.w3.org/2001/XMLSchema#decimal>,?key4=\"TRUE\"^^<http://www.w3.org/2001/XMLSchema#boolean>,?key5=\"1.5\"^^<http://www.w3.org/2001/XMLSchema#decimal>")
         expect_equal(user_agent$options$useragent, user_agent())
         return(success_message_response_with_content(mock_response_local_content_path, 
             "application/csv"))
     }, `mime::guess_type` = function(...) NULL, dwapi::sparql(dataset = dataset, query = sql_query, 
         query_params = query_parameters)) at testthat/test_sparql.R:30
  2: extract_mocks(new_values = new_values[!code_pos], .env = .env, eval_env = parent.frame())
  3: lapply(stats::setNames(nm = mock_qual_names), function(qual_name) {
         pkg_name <- gsub(pkg_and_name_rx, "\\1", qual_name)
         if (is_base_pkg(pkg_name)) {
             stop("Can't mock functions in base packages (", pkg_name, ")", call. = FALSE)
         }
         name <- gsub(pkg_and_name_rx, "\\2", qual_name)
         if (pkg_name == "") 
             pkg_name <- .env
         env <- asNamespace(pkg_name)
         if (!exists(name, envir = env, mode = "function")) 
             stop("Function ", name, " not found in environment ", environmentName(env), 
                 ".", call. = FALSE)
         mock(name = name, env = env, new = eval(new_values[[qual_name]], eval_env, eval_env))
     })
  4: FUN(X[[i]], ...)
  5: is_base_pkg(pkg_name)
  6: x %in% rownames(utils::installed.packages(priority = "base"))
  7: rownames(utils::installed.packages(priority = "base"))
  8: utils::installed.packages(priority = "base")
  9: saveRDS(list(base = base, value = ret0), dest)
  10: gzfile(file, mode)
  
  ── 7. Error: SQL query making the correct HTTR request (@test_sql.R#24)  ───────
  cannot open the connection
  1: with_mock(`httr::GET` = function(url, query, header, user_agent) {
         expect_equal(url, sprintf("https://query.data.world/sql/%s", dataset))
         expect_equal(header$headers[["Authorization"]], "Bearer API_TOKEN")
         expect_equal(header$headers[["Accept"]], "text/csv")
         expect_equal(query[["query"]], sql_query)
         expect_equal(query[["parameters"]], "$data_world_param0=\"value1\",$data_world_param1=\"1\"^^<http://www.w3.org/2001/XMLSchema#integer>,$data_world_param2=\"1\"^^<http://www.w3.org/2001/XMLSchema#decimal>,$data_world_param3=\"TRUE\"^^<http://www.w3.org/2001/XMLSchema#boolean>,$data_world_param4=\"1.5\"^^<http://www.w3.org/2001/XMLSchema#decimal>")
         expect_equal(user_agent$options$useragent, user_agent())
         return(success_message_response_with_content(mock_response_local_content_path, 
             "application/csv"))
     }, `mime::guess_type` = function(...) NULL, dwapi::sql(dataset = dataset, query = sql_query, 
         query_params = query_parameters)) at testthat/test_sql.R:24
  2: extract_mocks(new_values = new_values[!code_pos], .env = .env, eval_env = parent.frame())
  3: lapply(stats::setNames(nm = mock_qual_names), function(qual_name) {
         pkg_name <- gsub(pkg_and_name_rx, "\\1", qual_name)
         if (is_base_pkg(pkg_name)) {
             stop("Can't mock functions in base packages (", pkg_name, ")", call. = FALSE)
         }
         name <- gsub(pkg_and_name_rx, "\\2", qual_name)
         if (pkg_name == "") 
             pkg_name <- .env
         env <- asNamespace(pkg_name)
         if (!exists(name, envir = env, mode = "function")) 
             stop("Function ", name, " not found in environment ", environmentName(env), 
                 ".", call. = FALSE)
         mock(name = name, env = env, new = eval(new_values[[qual_name]], eval_env, eval_env))
     })
  4: FUN(X[[i]], ...)
  5: is_base_pkg(pkg_name)
  6: x %in% rownames(utils::installed.packages(priority = "base"))
  7: rownames(utils::installed.packages(priority = "base"))
  8: utils::installed.packages(priority = "base")
  9: saveRDS(list(base = base, value = ret0), dest)
  10: gzfile(file, mode)
  
  ── 8. Error: sync making the correct HTTR request (@test_sync_dataset.R#20)  ───
  cannot open the connection
  1: with_mock(`httr::POST` = function(url, header, user_agent) {
         expect_equal(url, "https://api.data.world/v0/datasets/ownerid/datasetid/sync")
         expect_equal(header$headers[["Authorization"]], "Bearer API_TOKEN")
         expect_equal(user_agent$options$useragent, user_agent())
         return(success_message_response())
     }, `mime::guess_type` = function(...) NULL, dwapi::sync(dataset = "ownerid/datasetid")) at testthat/test_sync_dataset.R:20
  2: extract_mocks(new_values = new_values[!code_pos], .env = .env, eval_env = parent.frame())
  3: lapply(stats::setNames(nm = mock_qual_names), function(qual_name) {
         pkg_name <- gsub(pkg_and_name_rx, "\\1", qual_name)
         if (is_base_pkg(pkg_name)) {
             stop("Can't mock functions in base packages (", pkg_name, ")", call. = FALSE)
         }
         name <- gsub(pkg_and_name_rx, "\\2", qual_name)
         if (pkg_name == "") 
             pkg_name <- .env
         env <- asNamespace(pkg_name)
         if (!exists(name, envir = env, mode = "function")) 
             stop("Function ", name, " not found in environment ", environmentName(env), 
                 ".", call. = FALSE)
         mock(name = name, env = env, new = eval(new_values[[qual_name]], eval_env, eval_env))
     })
  4: FUN(X[[i]], ...)
  5: is_base_pkg(pkg_name)
  6: x %in% rownames(utils::installed.packages(priority = "base"))
  7: rownames(utils::installed.packages(priority = "base"))
  8: utils::installed.packages(priority = "base")
  9: saveRDS(list(base = base, value = ret0), dest)
  10: gzfile(file, mode)
  
  ── 9. Error: update_dataset making the correct HTTR request (@test_update_datase
  cannot open the connection
  1: with_mock(`httr::PATCH` = function(url, body, header, user_agent) {
         expect_equal(url, "https://api.data.world/v0/datasets/ownerid/datasetid")
         expect_equal(header$headers[["Authorization"]], "Bearer API_TOKEN")
         expect_equal(body, rjson::toJSON(request))
         expect_equal(user_agent$options$useragent, user_agent())
         return(success_message_response())
     }, `mime::guess_type` = function(...) NULL, dwapi::update_dataset("ownerid/datasetid", 
         dataset_update_req = request)) at testthat/test_update_dataset.R:22
  2: extract_mocks(new_values = new_values[!code_pos], .env = .env, eval_env = parent.frame())
  3: lapply(stats::setNames(nm = mock_qual_names), function(qual_name) {
         pkg_name <- gsub(pkg_and_name_rx, "\\1", qual_name)
         if (is_base_pkg(pkg_name)) {
             stop("Can't mock functions in base packages (", pkg_name, ")", call. = FALSE)
         }
         name <- gsub(pkg_and_name_rx, "\\2", qual_name)
         if (pkg_name == "") 
             pkg_name <- .env
         env <- asNamespace(pkg_name)
         if (!exists(name, envir = env, mode = "function")) 
             stop("Function ", name, " not found in environment ", environmentName(env), 
                 ".", call. = FALSE)
         mock(name = name, env = env, new = eval(new_values[[qual_name]], eval_env, eval_env))
     })
  4: FUN(X[[i]], ...)
  5: is_base_pkg(pkg_name)
  6: x %in% rownames(utils::installed.packages(priority = "base"))
  7: rownames(utils::installed.packages(priority = "base"))
  8: utils::installed.packages(priority = "base")
  9: saveRDS(list(base = base, value = ret0), dest)
  10: gzfile(file, mode)
  
  ── 10. Error: update_table_schema making the correct HTTR request (@test_update_
  cannot open the connection
  1: with_mock(`httr::PATCH` = function(url, body, header, user_agent) {
         expect_equal(url, "https://query.data.world/tables/ownerid/datasetid/tableid/schema")
         expect_equal(header$headers[["Authorization"]], "Bearer API_TOKEN")
         expect_equal(body, rjson::toJSON(request))
         expect_equal(user_agent$options$useragent, user_agent())
         return(success_message_response())
     }, `mime::guess_type` = function(...) NULL, dwapi::update_table_schema("ownerid/datasetid", 
         "tableid", request)) at testthat/test_update_table_schema.R:24
  2: extract_mocks(new_values = new_values[!code_pos], .env = .env, eval_env = parent.frame())
  3: lapply(stats::setNames(nm = mock_qual_names), function(qual_name) {
         pkg_name <- gsub(pkg_and_name_rx, "\\1", qual_name)
         if (is_base_pkg(pkg_name)) {
             stop("Can't mock functions in base packages (", pkg_name, ")", call. = FALSE)
         }
         name <- gsub(pkg_and_name_rx, "\\2", qual_name)
         if (pkg_name == "") 
             pkg_name <- .env
         env <- asNamespace(pkg_name)
         if (!exists(name, envir = env, mode = "function")) 
             stop("Function ", name, " not found in environment ", environmentName(env), 
                 ".", call. = FALSE)
         mock(name = name, env = env, new = eval(new_values[[qual_name]], eval_env, eval_env))
     })
  4: FUN(X[[i]], ...)
  5: is_base_pkg(pkg_name)
  6: x %in% rownames(utils::installed.packages(priority = "base"))
  7: rownames(utils::installed.packages(priority = "base"))
  8: utils::installed.packages(priority = "base")
  9: saveRDS(list(base = base, value = ret0), dest)
  10: gzfile(file, mode)
  
  ── 11. Error: uploadDataFrame making the correct HTTR request (@test_upload_data
  cannot open the connection
  1: tryCatch({
         df <- data.frame(a = c(1, 2, 3), b = c(4, 5, 6))
         response <- with_mock(`httr::PUT` = function(url, body, header, progress, user_agent) {
             expect_equal(url, "https://api.data.world/v0/uploads/ownerid/datasetid/files/df.csv")
             expect_equal(header$headers[["Authorization"]], "Bearer API_TOKEN")
             expect_equal(header$headers[["Content-Type"]], "application/octet-stream")
             expect_equal(class(body), "form_file")
             actual <- as.data.frame(readr::read_csv(body$path))
             expect_equal(all(df == actual), TRUE)
             expect_equal(user_agent$options$useragent, user_agent())
             return(success_message_response())
         }, `mime::guess_type` = function(...) NULL, dwapi::upload_data_frame(dataset = "ownerid/datasetid", 
             file_name = "df.csv", data_frame = df))
         expect_equal(class(response), "success_message")
     }, finally = {
         cleanup_tmp_dir()
     }) at testthat/test_upload_data_frame.R:20
  2: tryCatchList(expr, classes, parentenv, handlers)
  3: with_mock(`httr::PUT` = function(url, body, header, progress, user_agent) {
         expect_equal(url, "https://api.data.world/v0/uploads/ownerid/datasetid/files/df.csv")
         expect_equal(header$headers[["Authorization"]], "Bearer API_TOKEN")
         expect_equal(header$headers[["Content-Type"]], "application/octet-stream")
         expect_equal(class(body), "form_file")
         actual <- as.data.frame(readr::read_csv(body$path))
         expect_equal(all(df == actual), TRUE)
         expect_equal(user_agent$options$useragent, user_agent())
         return(success_message_response())
     }, `mime::guess_type` = function(...) NULL, dwapi::upload_data_frame(dataset = "ownerid/datasetid", 
         file_name = "df.csv", data_frame = df)) at testthat/test_upload_data_frame.R:22
  4: extract_mocks(new_values = new_values[!code_pos], .env = .env, eval_env = parent.frame())
  5: lapply(stats::setNames(nm = mock_qual_names), function(qual_name) {
         pkg_name <- gsub(pkg_and_name_rx, "\\1", qual_name)
         if (is_base_pkg(pkg_name)) {
             stop("Can't mock functions in base packages (", pkg_name, ")", call. = FALSE)
         }
         name <- gsub(pkg_and_name_rx, "\\2", qual_name)
         if (pkg_name == "") 
             pkg_name <- .env
         env <- asNamespace(pkg_name)
         if (!exists(name, envir = env, mode = "function")) 
             stop("Function ", name, " not found in environment ", environmentName(env), 
                 ".", call. = FALSE)
         mock(name = name, env = env, new = eval(new_values[[qual_name]], eval_env, eval_env))
     })
  6: FUN(X[[i]], ...)
  7: is_base_pkg(pkg_name)
  8: x %in% rownames(utils::installed.packages(priority = "base"))
  9: rownames(utils::installed.packages(priority = "base"))
  10: utils::installed.packages(priority = "base")
  11: saveRDS(list(base = base, value = ret0), dest)
  12: gzfile(file, mode)
  
  ── 12. Error: uploadFile making the correct HTTR request (@test_upload_file.R#22
  cannot open the connection
  1: with_mock(`httr::PUT` = function(url, body, header, progress, user_agent) {
         expect_equal(url, "https://api.data.world/v0/uploads/ownerid/datasetid/files/file1.csv")
         expect_equal(header$headers[["Authorization"]], "Bearer API_TOKEN")
         expect_equal(header$headers[["Content-Type"]], "application/octet-stream")
         expect_equal(class(body), "form_file")
         expect_equal(user_agent$options$useragent, user_agent())
         expect_equal(body$path, expected$path)
         return(success_message_response())
     }, `mime::guess_type` = function(...) NULL, dwapi::upload_file(file_name = "file1.csv", 
         path = local_path, dataset = "ownerid/datasetid")) at testthat/test_upload_file.R:22
  2: extract_mocks(new_values = new_values[!code_pos], .env = .env, eval_env = parent.frame())
  3: lapply(stats::setNames(nm = mock_qual_names), function(qual_name) {
         pkg_name <- gsub(pkg_and_name_rx, "\\1", qual_name)
         if (is_base_pkg(pkg_name)) {
             stop("Can't mock functions in base packages (", pkg_name, ")", call. = FALSE)
         }
         name <- gsub(pkg_and_name_rx, "\\2", qual_name)
         if (pkg_name == "") 
             pkg_name <- .env
         env <- asNamespace(pkg_name)
         if (!exists(name, envir = env, mode = "function")) 
             stop("Function ", name, " not found in environment ", environmentName(env), 
                 ".", call. = FALSE)
         mock(name = name, env = env, new = eval(new_values[[qual_name]], eval_env, eval_env))
     })
  4: FUN(X[[i]], ...)
  5: is_base_pkg(pkg_name)
  6: x %in% rownames(utils::installed.packages(priority = "base"))
  7: rownames(utils::installed.packages(priority = "base"))
  8: utils::installed.packages(priority = "base")
  9: saveRDS(list(base = base, value = ret0), dest)
  10: gzfile(file, mode)
  
  ── 13. Error: uploadFiles making the correct HTTR request (@test_upload_file.R#4
  cannot open the connection
  1: with_mock(`httr::POST` = function(url, body, header, progress, user_agent) {
         expect_equal(url, "https://api.data.world/v0/uploads/ownerid/datasetid/files")
         expect_equal(header$headers[["Authorization"]], "Bearer API_TOKEN")
         expect_equal(header$headers[["Content-Type"]], "multipart/form-data")
         expect_equal(names(body), c("file", "file"))
         expect_equal(curl::form_file(local_path1)$path, body[[1]]$path)
         expect_equal(curl::form_file(local_path2)$path, body[[2]]$path)
         expect_equal(user_agent$options$useragent, user_agent())
         return(success_message_response())
     }, `mime::guess_type` = function(...) NULL, dwapi::upload_files(dataset = "ownerid/datasetid", 
         paths = list(local_path1, local_path2))) at testthat/test_upload_file.R:47
  2: extract_mocks(new_values = new_values[!code_pos], .env = .env, eval_env = parent.frame())
  3: lapply(stats::setNames(nm = mock_qual_names), function(qual_name) {
         pkg_name <- gsub(pkg_and_name_rx, "\\1", qual_name)
         if (is_base_pkg(pkg_name)) {
             stop("Can't mock functions in base packages (", pkg_name, ")", call. = FALSE)
         }
         name <- gsub(pkg_and_name_rx, "\\2", qual_name)
         if (pkg_name == "") 
             pkg_name <- .env
         env <- asNamespace(pkg_name)
         if (!exists(name, envir = env, mode = "function")) 
             stop("Function ", name, " not found in environment ", environmentName(env), 
                 ".", call. = FALSE)
         mock(name = name, env = env, new = eval(new_values[[qual_name]], eval_env, eval_env))
     })
  4: FUN(X[[i]], ...)
  5: is_base_pkg(pkg_name)
  6: x %in% rownames(utils::installed.packages(priority = "base"))
  7: rownames(utils::installed.packages(priority = "base"))
  8: utils::installed.packages(priority = "base")
  9: saveRDS(list(base = base, value = ret0), dest)
  10: gzfile(file, mode)
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  OK: 48 SKIPPED: 0 FAILED: 13
  1. Error: get_table_as_dataframe making the correct HTTR request (@test_download_table_as_data_frame.R#22) 
  2. Error: getDataset making the correct HTTR request (@test_get_dataset.R#20) 
  3. Error: get_table_schema making the correct HTTR request (@test_get_table_schema.R#20) 
  4. Error: list_tables making the correct HTTR request (@test_list_tables.R#20) 
  5. Error: replaceDataset making the correct HTTR request (@test_replace_dataset.R#23) 
  6. Error: SPARQL query making the correct HTTR request (@test_sparql.R#30) 
  7. Error: SQL query making the correct HTTR request (@test_sql.R#24) 
  8. Error: sync making the correct HTTR request (@test_sync_dataset.R#20) 
  9. Error: update_dataset making the correct HTTR request (@test_update_dataset.R#22) 
  1. ...
  
  Error: testthat unit tests failed
  Execution halted