Running ‘testthat.R’ [20s/29s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > # This file is part of the standard setup for testthat.
  > # It is recommended that you do not modify it.
  > #
  > # Where should you do additional test configuration?
  > # Learn more about the roles of various files in:
  > # * https://r-pkgs.org/testing-design.html#sec-tests-files-overview
  > # * https://testthat.r-lib.org/articles/special-files.html
  > 
  > library(testthat)
  > library(dawaR)
  ## {dawaR} provides data from the Danish Agency of Climate Data
  ## Terms and conditions apply.
  ## Read more at: https://dawadocs.dataforsyningen.dk/dok/om#vilkaar
  > 
  > test_check("dawaR")
  Starting 2 test processes
  [ FAIL 11 | WARN 0 | SKIP 14 | PASS 31 ]
  
  ══ Skipped tests (14) ══════════════════════════════════════════════════════════
  • On CRAN (12): 'test-2-get_data-sections.R:2:3',
    'test-3-get_map_data-sections.R:2:3', 'test-afstemningsomraader.R:3:3',
    'test-get_map_data-kommuner.R:2:3', 'test-get_map_data-politikredse.R:2:3',
    'test-get_map_data-regioner.R:2:3', 'test-get_map_data-vote.R:2:3',
    'test-get_map_data.R:3:3', 'test-status_check.R:20:3',
    'test-status_check.R:20:3', 'test-status_check.R:20:3',
    'test-status_check.R:20:3'
  • connection_check() is not TRUE (2): 'test-afstemningsomraader.R:20:3',
    'test-autocomplete.R:2:3'
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Failure ('test-base_api.R:4:3'): API base function properly ─────────────────
  `dawa(section = "base")` did not throw the expected error.
  ── Error ('test-base_api.R:8:3'): API base function properly ───────────────────
  <httr2_http_500/httr2_http/httr2_error/rlang_error/error/condition>
  Error in `httr2::req_perform(httr2::request("https://api.dataforsyningen.dk/sogne"))`: HTTP 500 Internal Server Error.
  Backtrace:
      ▆
   1. ├─httr2::resp_body_json(httr2::req_perform(httr2::request("https://api.dataforsyningen.dk/sogne"))) at test-base_api.R:8:3
   2. │ └─httr2:::check_response(resp)
   3. │   └─httr2:::is_response(resp)
   4. └─httr2::req_perform(httr2::request("https://api.dataforsyningen.dk/sogne"))
   5.   └─httr2:::handle_resp(req, resp, error_call = error_call)
   6.     └─httr2:::resp_abort(resp, req, body, call = error_call)
   7.       └─rlang::abort(...)
  ── Error ('test-get_data.R:3:3'): get_data() returns data and in the proper format ──
  Error in `resp_header_exists(resp, "content-type")`: `resp` must be an HTTP response object, not `NULL`.
  Backtrace:
      ▆
   1. └─dawaR::get_data("regioner") at test-get_data.R:3:3
   2.   └─dawaR::dawa(...)
   3.     └─httr2::resp_content_type(resp)
   4.       └─httr2::resp_header_exists(resp = resp)
   5.         └─httr2:::check_response(resp)
   6.           └─httr2:::stop_input_type(...)
   7.             └─rlang::abort(message, ..., call = call, arg = arg)
  ── Error ('test-get_map_data-postnumre.R:6:3'): Postal code bounding box is the same as regions ──
  Error in `writeLines(api_response, temp_file)`: can only write character objects
  Backtrace:
      ▆
   1. ├─sf::st_bbox(dawaR::get_map_data("regioner"), dk) at test-get_map_data-postnumre.R:6:3
   2. └─dawaR::get_map_data("regioner")
   3.   ├─dawaR:::get_map_data_w_cache(type = type, params = params)
   4.   │ ├─base::withVisible(eval(mc, parent.frame()))
   5.   │ └─base::eval(mc, parent.frame())
   6.   │   └─base::eval(mc, parent.frame())
   7.   └─dawaR (local) `<fn>`(type = type, params = params)
   8.     └─dawaR:::get_map_data_nocache(type = type, cache = TRUE, params = params)
   9.       └─base::writeLines(api_response, temp_file)
  ── Error ('test-reverse.R:3:3'): reverse geocode returns information reliably ──
  Error in `resp_header_exists(resp, "content-type")`: `resp` must be an HTTP response object, not `NULL`.
  Backtrace:
      ▆
   1. └─dawaR::reverse("regioner", x = 12.58515, y = 55.68324)
   2.   └─dawaR::dawa(...)
   3.     └─httr2::resp_content_type(resp)
   4.       └─httr2::resp_header_exists(resp = resp)
   5.         └─httr2:::check_response(resp)
   6.           └─httr2:::stop_input_type(...)
   7.             └─rlang::abort(message, ..., call = call, arg = arg)
  ── Failure ('test-1-dawa-sections.R:3:5'): All sections are applicable for dawa ──
  Expected `dawa(section = section, per_side = 50)` to run without any errors.
  i Actually got a <rlang_error> with text:
    `resp` must be an HTTP response object, not `NULL`.
  ── Failure ('test-1-dawa-sections.R:3:5'): All sections are applicable for dawa ──
  Expected `dawa(section = section, per_side = 50)` to run without any errors.
  i Actually got a <rlang_error> with text:
    `resp` must be an HTTP response object, not `NULL`.
  ── Failure ('test-1-dawa-sections.R:3:5'): All sections are applicable for dawa ──
  Expected `dawa(section = section, per_side = 50)` to run without any errors.
  i Actually got a <rlang_error> with text:
    `resp` must be an HTTP response object, not `NULL`.
  ── Failure ('test-1-dawa-sections.R:3:5'): All sections are applicable for dawa ──
  Expected `dawa(section = section, per_side = 50)` to run without any errors.
  i Actually got a <rlang_error> with text:
    `resp` must be an HTTP response object, not `NULL`.
  ── Failure ('test-1-dawa-sections.R:3:5'): All sections are applicable for dawa ──
  Expected `dawa(section = section, per_side = 50)` to run without any errors.
  i Actually got a <rlang_error> with text:
    `resp` must be an HTTP response object, not `NULL`.
  ── Failure ('test-1-dawa-sections.R:3:5'): All sections are applicable for dawa ──
  Expected `dawa(section = section, per_side = 50)` to run without any errors.
  i Actually got a <rlang_error> with text:
    `resp` must be an HTTP response object, not `NULL`.
  
  [ FAIL 11 | WARN 0 | SKIP 14 | PASS 31 ]
  Error: Test failures
  Execution halted