tests/testthat/test_early_day_motions.R

library(hansard)
context("early day motions")

test_that("edm functions return expected format", {
  skip_on_cran()
  skip_on_travis()

  # xedmid <- hansard_early_day_motions(edm_id = 1073)
  # expect_length(xedmid, 11)
  # expect_type(xedmid, "list")
  # expect_true(tibble::is_tibble(xedmid))

  xedmids <- hansard_early_day_motions(
    edm_id = 1073,
    session = "2015/16", verbose = TRUE
  )
  expect_length(xedmids, 11)
  expect_type(xedmids, "list")
  expect_true(tibble::is_tibble(xedmids))
  expect_equal(nrow(xedmids), 1)

  xedmid_full <- hansard_mp_edms(
    mp_id = 3967, primary_sponsor = TRUE,
    sponsor = FALSE, signatory = FALSE,
    full_data = TRUE, end_date = "2015-02-11",
    start_date = "2015-02-10", verbose = TRUE
  )
  expect_length(xedmid_full, 21)
  expect_true(tibble::is_tibble(xedmid_full))
  expect_equal(nrow(xedmid_full), 2)
})

Try the hansard package in your browser

Any scripts or data that you put into this service are public.

hansard documentation built on Nov. 13, 2019, 5:06 p.m.