Running ‘testthat.R’ [2s/13s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(rcongresso)
  > 
  > test_check("rcongresso")
  ── 1. Failure: GET deputado inexistente (@test_deputados.R#3)  ─────────────────
  `fetch_deputado(22)` did not throw an error.
  
  ── 2. Error: (unknown) (@test_deputados.R#10)  ─────────────────────────────────
  Results 1 must be data frames, not list
  1: fetch_despesas_deputado(id_abel_mesquita) at testthat/test_deputados.R:10
  2: tibble::tibble(id = dep_id) %>% dplyr::mutate(path = paste0(.DEPUTADOS_PATH, "/", 
         id, "/despesas")) %>% dplyr::group_by(id, path) %>% dplyr::do(.congresso_api(.$path, 
         query)$dados) %>% dplyr::ungroup() %>% dplyr::mutate(idDep = .$id) %>% dplyr::select(-path, 
         -id)
  3: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  4: eval(quote(`_fseq`(`_lhs`)), env, env)
  5: eval(quote(`_fseq`(`_lhs`)), env, env)
  6: `_fseq`(`_lhs`)
  7: freduce(value, `_function_list`)
  8: function_list[[i]](value)
  9: dplyr::do(., .congresso_api(.$path, query)$dados)
  10: do.grouped_df(., .congresso_api(.$path, query)$dados)
  11: label_output_dataframe(labels, out, groups(.data))
  12: bad("Results {bad} must be data frames, not {first_bad_class}", bad = fmt_comma(which(!data_frame)), 
         first_bad_class = fmt_classes(out[[1]][[which.min(data_frame)]]))
  13: glubort(NULL, ..., .envir = parent.frame())
  14: .abort(text)
  
  ── 3. Error: (unknown) (@test_proposicoes.R#10)  ───────────────────────────────
  Column `id` must be a 1d atomic vector or a list
  1: fetch_status_proposicao(pec_241_id) at testthat/test_proposicoes.R:10
  2: tibble::tibble(id = id_prop) %>% dplyr::mutate(path = paste0(.PROPOSICOES_PATH, "/", 
         id)) %>% dplyr::group_by(id) %>% dplyr::do(.congresso_api(.$path)$dados$statusProposicao %>% 
         .remove_lists_and_nulls()) %>% dplyr::ungroup()
  3: eval(lhs, parent, parent)
  4: eval(lhs, parent, parent)
  5: tibble::tibble(id = id_prop)
  6: as_tibble(lst_quos(xs, expand = TRUE))
  7: as_tibble.list(lst_quos(xs, expand = TRUE))
  8: list_to_tibble(x, validate)
  9: check_tibble(x)
  10: invalid_df("must be [a] 1d atomic vector(s) or [a] list(s)", x, !is_1d)
  11: stopc(pluralise_msg("Column(s) ", vars), " ", pluralise(problem, vars))
  12: abort(paste0(...))
  
  ── 4. Error: (unknown) (@test_votacoes.R#9)  ───────────────────────────────────
  Not Found (HTTP 404).
  1: fetch_votacoes(2088351) %>% ultima_votacao() at testthat/test_votacoes.R:9
  2: eval(lhs, parent, parent)
  3: eval(lhs, parent, parent)
  4: fetch_votacoes(2088351)
  5: tibble::tibble(id = id_prop) %>% dplyr::mutate(path = paste0(.PROPOSICOES_PATH, "/", 
         id, "/votacoes")) %>% dplyr::rowwise() %>% dplyr::do(.congresso_api(.$path)[[1]]) %>% 
         dplyr::ungroup()
  6: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  7: eval(quote(`_fseq`(`_lhs`)), env, env)
  8: eval(quote(`_fseq`(`_lhs`)), env, env)
  9: `_fseq`(`_lhs`)
  10: freduce(value, `_function_list`)
  11: function_list[[i]](value)
  12: dplyr::do(., .congresso_api(.$path)[[1]])
  13: do.rowwise_df(., .congresso_api(.$path)[[1]])
  14: overscope_eval_next(overscope, args[[j]])
  15: .congresso_api(.$path)
  16: httr::stop_for_status(resp)
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  OK: 4 SKIPPED: 0 FAILED: 4
  1. Failure: GET deputado inexistente (@test_deputados.R#3) 
  2. Error: (unknown) (@test_deputados.R#10) 
  3. Error: (unknown) (@test_proposicoes.R#10) 
  4. Error: (unknown) (@test_votacoes.R#9) 
  
  Error: testthat unit tests failed
  Execution halted