tests/testthat/test-fundamentals-metrics.R

test_that("can get fundamentals metrics", {
  skip_if_no_token()

  x <- riingo_fundamentals_metrics(c("AAPL", "MSFT"), start_date = "2020-01-01")

  cols <- c(
    "ticker", "date", "marketCap", "enterpriseVal", "peRatio",
    "pbRatio", "trailingPEG1Y"
  )

  expect_identical(all(cols %in% names(x)), TRUE)
  expect_identical(unique(x$ticker), c("AAPL", "MSFT"))
})

Try the riingo package in your browser

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

riingo documentation built on Sept. 13, 2020, 5:15 p.m.