Running ‘testthat.R’ [0m/23m]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(klassR)
  > 
  > test_check("klassR")
  Connection failed with error code 502
  Saving _problems/test-UpdateKlass-60.R
  Connection failed with error code 502
  Saving _problems/test-UpdateKlass-130.R
  Connection failed with error code 502
  Saving _problems/test_ApplyKlass-6.R
  Connection failed with error code 502
  Saving _problems/test_ApplyKlass-16.R
  Connection failed with error code 503
  Saving _problems/test_ApplyKlass-39.R
  Connection failed with error code 502
  Saving _problems/test_ApplyKlass-54.R
  Connection failed with error code 502
  Saving _problems/test_ApplyKlass-63.R
  Connection failed with error code 502
  Saving _problems/test_ApplyKlass-70.R
  Connection failed with error code 502
  Saving _problems/test_ApplyKlass-84.R
  Connection failed with error code 502
  Saving _problems/test_ApplyKlass-109.R
  Connection failed with error code 502
  Saving _problems/test_ApplyKlass-134.R
  Connection failed with error code 502
  Saving _problems/test_ApplyKlass-168.R
  Connection failed with error code 502
  Saving _problems/test_GetKlass-4.R
  Connection failed with error code 502
  Saving _problems/test_GetKlass-10.R
  Connection failed with error code 502
  Saving _problems/test_GetKlass-16.R
  Connection failed with error code 502
  Saving _problems/test_GetKlass-60.R
  Saving _problems/test_GetKlass-79.R
  Saving _problems/test_GetKlass-88.R
  Connection failed with error code 502
  Saving _problems/test_GetKlass-99.R
  Saving _problems/test_GetKlass-107.R
  Connection failed with error code 502
  Saving _problems/test_GetKlass-118.R
  Connection failed with error code 404
  Connection failed with error code 502
  Saving _problems/test_GetKlass-158.R
  Connection failed with error code 502
  Saving _problems/test_GetKlass-163.R
  Connection failed with error code 502
  Connection failed with error code 502
  Saving _problems/test_ListKlass-15.R
  Connection failed with error code 502
  Saving _problems/test_ListKlass-18.R
  [ FAIL 25 | WARN 0 | SKIP 0 | PASS 47 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-UpdateKlass.R:57:3'): update_klass gir riktig resultat ved sammenslåtte koder ──
  Error: Argument 'txt' must be a JSON string, URL or file.
  Backtrace:
      ▆
   1. └─jsonlite::fromJSON(klassR:::GetUrl2(changes_url), flatten = TRUE) at test-UpdateKlass.R:57:3
   2.   └─jsonlite:::stop("Argument 'txt' must be a JSON string, URL or file.")
  ── Error ('test-UpdateKlass.R:127:3'): update_klass gir riktig resultat ved delte koder ──
  Error: Argument 'txt' must be a JSON string, URL or file.
  Backtrace:
      ▆
   1. └─jsonlite::fromJSON(klassR:::GetUrl2(changes_url), flatten = TRUE) at test-UpdateKlass.R:127:3
   2.   └─jsonlite:::stop("Argument 'txt' must be a JSON string, URL or file.")
  ── Error ('test_ApplyKlass.R:3:3'): apply_klass returns correct names for numeric codes ──
  Error in `stop_quietly()`: 
  Backtrace:
      ▆
   1. └─klassR::apply_klass(...) at test_ApplyKlass.R:3:3
   2.   └─klassR::get_klass(...)
   3.     └─klassR:::stop_quietly()
  ── Error ('test_ApplyKlass.R:13:3'): apply_klass returns correct names for numeric codes ──
  Error in `stop_quietly()`: 
  Backtrace:
      ▆
   1. └─klassR::apply_klass(...) at test_ApplyKlass.R:13:3
   2.   └─klassR::get_klass(...)
   3.     └─klassR:::stop_quietly()
  ── Error ('test_ApplyKlass.R:33:3'): apply_klass returns correct language ──────
  Error in `stop_quietly()`: 
  Backtrace:
      ▆
   1. └─klassR::apply_klass(...) at test_ApplyKlass.R:33:3
   2.   └─klassR::get_klass(...)
   3.     └─klassR:::stop_quietly()
  ── Error ('test_ApplyKlass.R:54:3'): apply_klass returns correctly for character codes ──
  Error in `stop_quietly()`: 
  Backtrace:
      ▆
   1. └─klassR::apply_klass(sektor, 39, date = "2020-01-01") at test_ApplyKlass.R:54:3
   2.   └─klassR::get_klass(...)
   3.     └─klassR:::stop_quietly()
  ── Error ('test_ApplyKlass.R:63:3'): Check levelCheck for numerical codes ──────
  Error in `stop_quietly()`: 
  Backtrace:
      ▆
   1. └─klassR::get_klass(6, date = "2020-01-01") at test_ApplyKlass.R:63:3
   2.   └─klassR:::stop_quietly()
  ── Error ('test_ApplyKlass.R:70:3'): Check levelCheck for character codes ──────
  Error in `stop_quietly()`: 
  Backtrace:
      ▆
   1. └─klassR::get_klass(39, date = "2020-01-01") at test_ApplyKlass.R:70:3
   2.   └─klassR:::stop_quietly()
  ── Error ('test_ApplyKlass.R:80:3'): apply_klass can return a variant classification ──
  Error in `stop_quietly()`: 
  Backtrace:
      ▆
   1. └─klassR::apply_klass(...) at test_ApplyKlass.R:80:3
   2.   └─klassR::get_klass(...)
   3.     └─klassR:::stop_quietly()
  ── Error ('test_ApplyKlass.R:102:5'): apply_klass works for variant classification with Norwegian characters in the variant name ──
  Error in `stop_quietly()`: 
  Backtrace:
      ▆
   1. └─klassR::apply_klass(...) at test_ApplyKlass.R:102:5
   2.   └─klassR::get_klass(...)
   3.     └─klassR:::stop_quietly()
  ── Error ('test_ApplyKlass.R:131:3'): Nace classification with missing formatting ──
  Error in `stop_quietly()`: 
  Backtrace:
      ▆
   1. ├─testthat::expect_warning(...) at test_ApplyKlass.R:131:3
   2. │ └─testthat:::expect_condition_matching_(...)
   3. │   └─testthat:::quasi_capture(...)
   4. │     ├─testthat (local) .capture(...)
   5. │     │ └─base::withCallingHandlers(...)
   6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
   7. └─klassR::apply_klass(dat, classification = 6, date = "2024-01-01")
   8.   └─klassR::get_klass(...)
   9.     └─klassR:::stop_quietly()
  ── Error ('test_ApplyKlass.R:165:3'): Municipality classification with missing formatting ──
  Error in `stop_quietly()`: 
  Backtrace:
      ▆
   1. ├─testthat::expect_warning(...) at test_ApplyKlass.R:165:3
   2. │ └─testthat:::expect_condition_matching_(...)
   3. │   └─testthat:::quasi_capture(...)
   4. │     ├─testthat (local) .capture(...)
   5. │     │ └─base::withCallingHandlers(...)
   6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
   7. └─klassR::apply_klass(dat, classification = 131, date = "2024-01-01")
   8.   └─klassR::get_klass(...)
   9.     └─klassR:::stop_quietly()
  ── Error ('test_GetKlass.R:4:3'): get_klass returns a classification ───────────
  Error in `stop_quietly()`: 
  Backtrace:
      ▆
   1. └─klassR::get_klass(131, date = "2015-01-01") at test_GetKlass.R:4:3
   2.   └─klassR:::stop_quietly()
  ── Error ('test_GetKlass.R:10:3'): get_klass returns a classification with Norwegian letters ──
  Error in `stop_quietly()`: 
  Backtrace:
      ▆
   1. └─klassR::get_klass(131, date = "2015-01-01") at test_GetKlass.R:10:3
   2.   └─klassR:::stop_quietly()
  ── Error ('test_GetKlass.R:16:3'): get_klass returns no error when no date given ──
  Error in `stop_quietly()`: 
  Backtrace:
      ▆
   1. ├─testthat::expect_type(get_klass(131), type = "list") at test_GetKlass.R:16:3
   2. │ └─testthat::quasi_label(enquo(object))
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─klassR::get_klass(131)
   5.   └─klassR:::stop_quietly()
  ── Error ('test_GetKlass.R:57:3'): get_klass returns correct output level ──────
  Error in `stop_quietly()`: 
  Backtrace:
      ▆
   1. └─klassR::get_klass(7, date = "2024-01-01", output_level = 1) at test_GetKlass.R:57:3
   2.   └─klassR:::stop_quietly()
  ── Error ('test_GetKlass.R:76:3'): get_klass returns a correspondence table ────
  Error: lexical error: invalid char in json text.
                                         <!DOCTYPE HTML PUBLIC "-//IETF/
                       (right here) ------^
  
  Backtrace:
      ▆
   1. └─klassR::get_klass(104, correspond = 131, date = "2015-01-01") at test_GetKlass.R:76:3
   2.   └─jsonlite::fromJSON(klass_text, flatten = TRUE)
   3.     └─jsonlite:::parse_and_simplify(...)
   4.       └─jsonlite:::parseJSON(txt, bigint_as_char)
   5.         └─jsonlite:::parse_string(txt, bigint_as_char)
  ── Error ('test_GetKlass.R:85:3'): get_klass returns a correspondence table in both directions ──
  Error: lexical error: invalid char in json text.
                                         <!DOCTYPE HTML PUBLIC "-//IETF/
                       (right here) ------^
  
  Backtrace:
      ▆
   1. └─klassR::get_klass(104, correspond = 131, date = "2020-02-01") at test_GetKlass.R:85:3
   2.   └─jsonlite::fromJSON(klass_text, flatten = TRUE)
   3.     └─jsonlite:::parse_and_simplify(...)
   4.       └─jsonlite:::parseJSON(txt, bigint_as_char)
   5.         └─jsonlite:::parse_string(txt, bigint_as_char)
  ── Error ('test_GetKlass.R:99:3'): get_klass returns a valid variant including ones with spaces in name ──
  Error in `stop_quietly()`: 
  Backtrace:
      ▆
   1. └─klassR::get_klass(6, variant = 1616, date = "2021-01-02") at test_GetKlass.R:99:3
   2.   └─klassR:::stop_quietly()
  ── Error ('test_GetKlass.R:107:3'): get_klass returns a correspondence table ───
  Error: lexical error: invalid char in json text.
                                         <!DOCTYPE HTML PUBLIC "-//IETF/
                       (right here) ------^
  
  Backtrace:
      ▆
   1. └─klassR::get_klass(131, correspond = 127, date = "2024-01-02") at test_GetKlass.R:107:3
   2.   └─jsonlite::fromJSON(klass_text, flatten = TRUE)
   3.     └─jsonlite:::parse_and_simplify(...)
   4.       └─jsonlite:::parseJSON(txt, bigint_as_char)
   5.         └─jsonlite:::parse_string(txt, bigint_as_char)
  ── Error ('test_GetKlass.R:116:3'): get_klass returns a correspondent using ID ──
  Error in `stop_quietly()`: 
  Backtrace:
      ▆
   1. ├─testthat::expect_message(...) at test_GetKlass.R:116:3
   2. │ └─testthat:::expect_condition_matching_(...)
   3. │   └─testthat:::quasi_capture(...)
   4. │     ├─testthat (local) .capture(...)
   5. │     │ └─base::withCallingHandlers(...)
   6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
   7. └─klassR::get_klass(correspondID = 1441, date = "2024-01-02")
   8.   └─klassR:::stop_quietly()
  ── Error ('test_GetKlass.R:158:3'): get_klass returns a correspondence table using ID ──
  Error in `stop_quietly()`: 
  Backtrace:
      ▆
   1. ├─testthat::expect_message(...) at test_GetKlass.R:158:3
   2. │ └─testthat:::expect_condition_matching_(...)
   3. │   └─testthat:::quasi_capture(...)
   4. │     ├─testthat (local) .capture(...)
   5. │     │ └─base::withCallingHandlers(...)
   6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
   7. └─klassR::get_klass(correspondID = 1111, date = "2023-01-12")
   8.   └─klassR:::stop_quietly()
  ── Error ('test_GetKlass.R:163:3'): get_klass returns valid dates for a date range ──
  Error in `stop_quietly()`: 
  Backtrace:
      ▆
   1. └─klassR::get_klass(131, date = c("2020-01-01", "2024-01-02")) at test_GetKlass.R:163:3
   2.   └─klassR:::stop_quietly()
  ── Failure ('test_ListKlass.R:15:3'): list_klass returns a list ────────────────
  Expected `nrow(klass_table)` > 1.
  Actual comparison: 0.0 <= 1.0
  Difference: -1.0 <= 0
  ── Failure ('test_ListKlass.R:18:3'): list_klass returns a list ────────────────
  Expected `nrow(codelist_table)` > `nrow(klass_table)`.
  Actual comparison: 0 <= 0
  Difference: 0 <= 0
  
  [ FAIL 25 | WARN 0 | SKIP 0 | PASS 47 ]
  Error:
  ! Test failures.
  Execution halted