Running 'testthat.R' [2s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > library(testthat)
  > library(kofdata)
  Loading required package: jsonlite
  Loading required package: httr
  > 
  > test_check("kofdata")
  [ FAIL 14 | WARN 0 | SKIP 6 | PASS 1 ]
  
  ══ Skipped tests (6) ═══════════════════════════════════════════════════════════
  • nchar(apikey) == 0 is TRUE (6): 'test_get_collection.R:13:3',
    'test_get_remaining_quota.R:6:3', 'test_get_time_series.R:13:3',
    'test_list_cached_files.R:6:3', 'test_list_collections.R:20:3',
    'test_list_keys.R:22:3'
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test_get_collection.R:4:3'): get_collection works for public collection ──
  Error in `curl::curl_fetch_memory(url, handle = handle)`: Could not resolve host: datenservice.kof.ethz.ch
  Backtrace:
      ▆
   1. └─kofdata::get_collection("baro_vintages_monthly") at test_get_collection.R:4:2
   2.   └─httr::GET(url, query = query)
   3.     └─httr:::request_perform(req, hu$handle$handle)
   4.       ├─httr:::request_fetch(req$output, req$url, handle)
   5.       └─httr:::request_fetch.write_memory(req$output, req$url, handle)
   6.         └─curl::curl_fetch_memory(url, handle = handle)
  ── Failure ('test_get_collection.R:23:3'): get_collection errors with invalid set ──
  `get_collection("some_nonexistent_set")` threw an error with unexpected message.
  Expected match: "The API responded"
  Actual message: "Could not resolve host: datenservice.kof.ethz.ch"
  Backtrace:
       ▆
    1. ├─testthat::expect_error(...) at test_get_collection.R:23:2
    2. │ └─testthat:::quasi_capture(...)
    3. │   ├─testthat (local) .capture(...)
    4. │   │ └─base::withCallingHandlers(...)
    5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    6. └─kofdata::get_collection("some_nonexistent_set")
    7.   └─httr::GET(url, query = query)
    8.     └─httr:::request_perform(req, hu$handle$handle)
    9.       ├─httr:::request_fetch(req$output, req$url, handle)
   10.       └─httr:::request_fetch.write_memory(req$output, req$url, handle)
   11.         └─curl::curl_fetch_memory(url, handle = handle)
  ── Failure ('test_get_collection.R:27:3'): get_collection errors with invalid api key ──
  `get_collection("set_doesnt_matter", "GandalfTheGray")` threw an error with unexpected message.
  Expected match: "Invalid API key"
  Actual message: "Could not resolve host: datenservice.kof.ethz.ch"
  Backtrace:
       ▆
    1. ├─testthat::expect_error(...) at test_get_collection.R:27:2
    2. │ └─testthat:::quasi_capture(...)
    3. │   ├─testthat (local) .capture(...)
    4. │   │ └─base::withCallingHandlers(...)
    5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    6. └─kofdata::get_collection("set_doesnt_matter", "GandalfTheGray")
    7.   └─httr::GET(url, query = query)
    8.     └─httr:::request_perform(req, hu$handle$handle)
    9.       ├─httr:::request_fetch(req$output, req$url, handle)
   10.       └─httr:::request_fetch.write_memory(req$output, req$url, handle)
   11.         └─curl::curl_fetch_memory(url, handle = handle)
  ── Error ('test_get_metadata.R:4:3'): get_metadata works ───────────────────────
  Error in `curl::curl_fetch_memory(url, handle = handle)`: Could not resolve host: datenservice.kof.ethz.ch
  Backtrace:
      ▆
   1. └─kofdata::get_metadata(...) at test_get_metadata.R:4:2
   2.   └─httr::GET(url, query = query)
   3.     └─httr:::request_perform(req, hu$handle$handle)
   4.       ├─httr:::request_fetch(req$output, req$url, handle)
   5.       └─httr:::request_fetch.write_memory(req$output, req$url, handle)
   6.         └─curl::curl_fetch_memory(url, handle = handle)
  ── Error ('test_get_metadata.R:12:3'): get_metadata returns NA for nonexistent keys ──
  Error in `curl::curl_fetch_memory(url, handle = handle)`: Could not resolve host: datenservice.kof.ethz.ch
  Backtrace:
      ▆
   1. ├─testthat::expect_true(is.na(get_metadata("nokey")[["nokey"]])) at test_get_metadata.R:12:2
   2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─kofdata::get_metadata("nokey")
   5.   └─httr::GET(url, query = query)
   6.     └─httr:::request_perform(req, hu$handle$handle)
   7.       ├─httr:::request_fetch(req$output, req$url, handle)
   8.       └─httr:::request_fetch.write_memory(req$output, req$url, handle)
   9.         └─curl::curl_fetch_memory(url, handle = handle)
  ── Error ('test_get_metadata.R:16:3'): get_metadata returns a list ─────────────
  Error in `curl::curl_fetch_memory(url, handle = handle)`: Could not resolve host: datenservice.kof.ethz.ch
  Backtrace:
      ▆
   1. ├─testthat::expect_is(...) at test_get_metadata.R:16:2
   2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─kofdata::get_metadata("ch.kof.inu.ng08.fx.sector_kof.cm.q_ql_chg_price_sales_p3m.share_eq")
   5.   └─httr::GET(url, query = query)
   6.     └─httr:::request_perform(req, hu$handle$handle)
   7.       ├─httr:::request_fetch(req$output, req$url, handle)
   8.       └─httr:::request_fetch.write_memory(req$output, req$url, handle)
   9.         └─curl::curl_fetch_memory(url, handle = handle)
  ── Failure ('test_get_remaining_quota.R:15:3'): get_remaining_quota errors with invalid api key ──
  `get_remaining_quota("some_nonexistent_key")` threw an error with unexpected message.
  Expected match: "Invalid API key"
  Actual message: "Could not resolve host: datenservice.kof.ethz.ch"
  Backtrace:
       ▆
    1. ├─testthat::expect_error(...) at test_get_remaining_quota.R:15:2
    2. │ └─testthat:::quasi_capture(...)
    3. │   ├─testthat (local) .capture(...)
    4. │   │ └─base::withCallingHandlers(...)
    5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    6. └─kofdata::get_remaining_quota("some_nonexistent_key")
    7.   ├─kofdata:::validate_response(...)
    8.   │ └─httr::status_code(response)
    9.   └─httr::GET(...)
   10.     └─httr:::request_perform(req, hu$handle$handle)
   11.       ├─httr:::request_fetch(req$output, req$url, handle)
   12.       └─httr:::request_fetch.write_memory(req$output, req$url, handle)
   13.         └─curl::curl_fetch_memory(url, handle = handle)
  ── Error ('test_get_time_series.R:4:3'): get_time_series works for public series ──
  Error in `curl::curl_fetch_memory(url, handle = handle)`: Could not resolve host: datenservice.kof.ethz.ch
  Backtrace:
      ▆
   1. └─kofdata::get_time_series("kofbarometer", show_progress = F) at test_get_time_series.R:4:2
   2.   └─httr::GET(url, query = query)
   3.     └─httr:::request_perform(req, hu$handle$handle)
   4.       ├─httr:::request_fetch(req$output, req$url, handle)
   5.       └─httr:::request_fetch.write_memory(req$output, req$url, handle)
   6.         └─curl::curl_fetch_memory(url, handle = handle)
  ── Failure ('test_get_time_series.R:24:3'): get_time_series errors on invalid key ──
  `get_time_series("some_nonexistent_key", show_progress = F)` threw an error with unexpected message.
  Expected match: "The API responded"
  Actual message: "Could not resolve host: datenservice.kof.ethz.ch"
  Backtrace:
       ▆
    1. ├─testthat::expect_error(...) at test_get_time_series.R:24:2
    2. │ └─testthat:::quasi_capture(...)
    3. │   ├─testthat (local) .capture(...)
    4. │   │ └─base::withCallingHandlers(...)
    5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    6. └─kofdata::get_time_series("some_nonexistent_key", show_progress = F)
    7.   └─httr::GET(url, query = query)
    8.     └─httr:::request_perform(req, hu$handle$handle)
    9.       ├─httr:::request_fetch(req$output, req$url, handle)
   10.       └─httr:::request_fetch.write_memory(req$output, req$url, handle)
   11.         └─curl::curl_fetch_memory(url, handle = handle)
  ── Failure ('test_get_time_series.R:28:3'): get_time_series errors on invalid api key ──
  `get_time_series("key_doesnt_matter", "GandalfTheGray", show_progress = F)` threw an error with unexpected message.
  Expected match: "Invalid API key"
  Actual message: "Could not resolve host: datenservice.kof.ethz.ch"
  Backtrace:
       ▆
    1. ├─testthat::expect_error(...) at test_get_time_series.R:28:2
    2. │ └─testthat:::quasi_capture(...)
    3. │   ├─testthat (local) .capture(...)
    4. │   │ └─base::withCallingHandlers(...)
    5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    6. └─kofdata::get_time_series(...)
    7.   └─httr::GET(url, query = query)
    8.     └─httr:::request_perform(req, hu$handle$handle)
    9.       ├─httr:::request_fetch(req$output, req$url, handle)
   10.       └─httr:::request_fetch.write_memory(req$output, req$url, handle)
   11.         └─curl::curl_fetch_memory(url, handle = handle)
  ── Failure ('test_list_cached_files.R:14:3'): list_cached_files errors with invalid username ──
  `list_cached_files("GandalfTheWhite", "myapikey")` threw an error with unexpected message.
  Expected match: "Username not found"
  Actual message: "Could not resolve host: datenservice.kof.ethz.ch"
  Backtrace:
       ▆
    1. ├─testthat::expect_error(...) at test_list_cached_files.R:14:2
    2. │ └─testthat:::quasi_capture(...)
    3. │   ├─testthat (local) .capture(...)
    4. │   │ └─base::withCallingHandlers(...)
    5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    6. └─kofdata::list_cached_files("GandalfTheWhite", "myapikey")
    7.   └─kofdata:::.get_cdc_files(username, api_key)
    8.     ├─kofdata:::validate_response(GET(listing_url, query = query))
    9.     │ └─httr::status_code(response)
   10.     └─httr::GET(listing_url, query = query)
   11.       └─httr:::request_perform(req, hu$handle$handle)
   12.         ├─httr:::request_fetch(req$output, req$url, handle)
   13.         └─httr:::request_fetch.write_memory(req$output, req$url, handle)
   14.           └─curl::curl_fetch_memory(url, handle = handle)
  ── Failure ('test_list_cached_files.R:18:3'): list_cached_files errors with invalid api key ──
  `list_cached_files("testuser", "notmyapikey")` threw an error with unexpected message.
  Expected match: "Invalid API key"
  Actual message: "Could not resolve host: datenservice.kof.ethz.ch"
  Backtrace:
       ▆
    1. ├─testthat::expect_error(...) at test_list_cached_files.R:18:2
    2. │ └─testthat:::quasi_capture(...)
    3. │   ├─testthat (local) .capture(...)
    4. │   │ └─base::withCallingHandlers(...)
    5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    6. └─kofdata::list_cached_files("testuser", "notmyapikey")
    7.   └─kofdata:::.get_cdc_files(username, api_key)
    8.     ├─kofdata:::validate_response(GET(listing_url, query = query))
    9.     │ └─httr::status_code(response)
   10.     └─httr::GET(listing_url, query = query)
   11.       └─httr:::request_perform(req, hu$handle$handle)
   12.         ├─httr:::request_fetch(req$output, req$url, handle)
   13.         └─httr:::request_fetch.write_memory(req$output, req$url, handle)
   14.           └─curl::curl_fetch_memory(url, handle = handle)
  ── Error ('test_list_collections.R:4:3'): list_available_collections works ─────
  Error in `curl::curl_fetch_memory(url, handle = handle)`: Could not resolve host: datenservice.kof.ethz.ch
  Backtrace:
      ▆
   1. └─kofdata::list_available_collections() at test_list_collections.R:4:2
   2.   └─httr::GET(url, query = query)
   3.     └─httr:::request_perform(req, hu$handle$handle)
   4.       ├─httr:::request_fetch(req$output, req$url, handle)
   5.       └─httr:::request_fetch.write_memory(req$output, req$url, handle)
   6.         └─curl::curl_fetch_memory(url, handle = handle)
  ── Error ('test_list_keys.R:5:3'): list_keys_in_collection works ───────────────
  Error in `curl::curl_fetch_memory(url, handle = handle)`: Could not resolve host: datenservice.kof.ethz.ch
  Backtrace:
      ▆
   1. └─kofdata::list_available_collections() at test_list_keys.R:5:2
   2.   └─httr::GET(url, query = query)
   3.     └─httr:::request_perform(req, hu$handle$handle)
   4.       ├─httr:::request_fetch(req$output, req$url, handle)
   5.       └─httr:::request_fetch.write_memory(req$output, req$url, handle)
   6.         └─curl::curl_fetch_memory(url, handle = handle)
  
  [ FAIL 14 | WARN 0 | SKIP 6 | PASS 1 ]
  Error: Test failures
  Execution halted