Running 'testthat.R' [548s]
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 12 | WARN 0 | SKIP 6 | PASS 3 ]
  
  ══ 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 `content(response, as = "text")`: is.response(x) is not TRUE
  Backtrace:
      ▆
   1. └─kofdata::get_collection("baro_vintages_monthly") at test_get_collection.R:4:3
   2.   ├─jsonlite::fromJSON(content(response, as = "text"))
   3.   └─httr::content(response, as = "text")
   4.     └─base::stopifnot(is.response(x))
  ── 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: "is.response(x) is not TRUE"
  Backtrace:
      ▆
   1. ├─testthat::expect_error(...) at test_get_collection.R:23:3
   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.   ├─jsonlite::fromJSON(content(response, as = "text"))
   8.   └─httr::content(response, as = "text")
   9.     └─base::stopifnot(is.response(x))
  ── 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: "is.response(x) is not TRUE"
  Backtrace:
      ▆
   1. ├─testthat::expect_error(...) at test_get_collection.R:27:3
   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.   ├─jsonlite::fromJSON(content(response, as = "text"))
   8.   └─httr::content(response, as = "text")
   9.     └─base::stopifnot(is.response(x))
  ── Failure ('test_get_metadata.R:8:3'): get_metadata works ─────────────────────
  length(some_meta) not equal to 3.
  1/1 mismatches
  [1] 4 - 3 == 1
  ── Failure ('test_get_metadata.R:16:3'): get_metadata returns a list ───────────
  get_metadata("ch.kof.inu.ng08.fx.sector_kof.cm.q_ql_chg_price_sales_p3m.share_eq")[[1]] inherits from `'character'` not `'character'`.
  ── 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: "is.response(x) is not TRUE"
  Backtrace:
      ▆
   1. ├─testthat::expect_error(...) at test_get_remaining_quota.R:15:3
   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.   ├─jsonlite::fromJSON(content(response, as = "text"))
   8.   └─httr::content(response, as = "text")
   9.     └─base::stopifnot(is.response(x))
  ── Error ('test_get_time_series.R:4:3'): get_time_series works for public series ──
  Error in `content(response, as = "text")`: is.response(x) is not TRUE
  Backtrace:
      ▆
   1. └─kofdata::get_time_series("kofbarometer", show_progress = F) at test_get_time_series.R:4:3
   2.   ├─jsonlite::fromJSON(content(response, as = "text"))
   3.   └─httr::content(response, as = "text")
   4.     └─base::stopifnot(is.response(x))
  ── 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: "is.response(x) is not TRUE"
  Backtrace:
      ▆
   1. ├─testthat::expect_error(...) at test_get_time_series.R:24:3
   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.   ├─jsonlite::fromJSON(content(response, as = "text"))
   8.   └─httr::content(response, as = "text")
   9.     └─base::stopifnot(is.response(x))
  ── 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: "is.response(x) is not TRUE"
  Backtrace:
      ▆
   1. ├─testthat::expect_error(...) at test_get_time_series.R:28:3
   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.   ├─jsonlite::fromJSON(content(response, as = "text"))
   8.   └─httr::content(response, as = "text")
   9.     └─base::stopifnot(is.response(x))
  ── 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: "is.response(x) is not TRUE"
  Backtrace:
       ▆
    1. ├─testthat::expect_error(...) at test_list_cached_files.R:18:3
    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.     ├─jsonlite::fromJSON(content(listing, as = "text"))
    9.     └─httr::content(listing, as = "text")
   10.       └─base::stopifnot(is.response(x))
  ── Error ('test_list_collections.R:4:3'): list_available_collections works ─────
  Error in `list_available_collections()`: An error occurred when calling the api:
  Status: 500
  Content:{"message":"An unexpected error occurred"}
  
  Backtrace:
      ▆
   1. └─kofdata::list_available_collections() at test_list_collections.R:4:3
  ── Error ('test_list_keys.R:5:3'): list_keys_in_collection works ───────────────
  Error in `list_available_collections()`: An error occurred when calling the api:
  Status: 500
  Content:{"message":"An unexpected error occurred"}
  
  Backtrace:
      ▆
   1. └─kofdata::list_available_collections() at test_list_keys.R:5:3
  
  [ FAIL 12 | WARN 0 | SKIP 6 | PASS 3 ]
  Error: Test failures
  Execution halted