tests/testthat/test-fredata.R

cache_folder <- tempdir()

test_that('fetching info companies (no cache)', {

  skip_on_cran()
  skip_if_offline()

  my_info <- get_info_companies(cache_folder = cache_folder)

  expect_true(
    (is.data.frame(my_info)) & (nrow(my_info) > 0)
  )

})

test_that('fetching info companies (with cache)', {

  skip_on_cran()
  skip_if_offline()

  my_info <- get_info_companies(cache_folder = cache_folder)

  expect_true(
    (is.data.frame(my_info)) & (nrow(my_info) > 0)
  )

})

test_that('fetch fre data', {

  skip_on_cran()
  skip_if_offline()

  my_id <- 19615
  l_fre <- get_fre_data(companies_cvm_codes = my_id,
                        first_year = 2020, last_year = 2020,
                        cache_folder = cache_folder)

  expect_true(
    (is.list(l_fre)) & (length(l_fre) > 0)
  )

})

Try the GetFREData package in your browser

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

GetFREData documentation built on June 13, 2022, 5:08 p.m.