tests/testthat/test_votings_get_votings_links.R

test_that("result of function", {
  expect_equal(class(votings_get_votings_links("http://www.sejm.gov.pl/Sejm7.nsf/",
    "http://www.sejm.gov.pl/Sejm7.nsf/agent.xsp?symbol=listaglos&IdDnia=1179")),
    "character")
})

test_that("format like link", {
  expect_true(all(stri_detect_regex(votings_get_votings_links("http://www.sejm.gov.pl/Sejm7.nsf/",
    "http://www.sejm.gov.pl/Sejm7.nsf/agent.xsp?symbol=listaglos&IdDnia=1182"),
    "^http")))
})


test_that("length", {
  expect_gt(length(votings_get_votings_links("http://www.sejm.gov.pl/Sejm8.nsf/",
    "http://www.sejm.gov.pl/Sejm8.nsf/agent.xsp?symbol=listaglos&IdDnia=1491")), 0)
})

Try the sejmRP package in your browser

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

sejmRP documentation built on May 2, 2019, 5:16 a.m.