tests/testthat/test-vulns.R

with_mock_dir('osv_vulns_req', {
  test_that("Can run mid level vulns query...", {

    expect_true(is_rosv(osv_vulns("RSEC-2023-8", parse = FALSE)))
    expect_true(is_rosv(osv_vulns("RSEC-2023-8", parse = TRUE)))
    expect_true(is_rosv(osv_vulns("RSEC-2023-8", cache = TRUE)))
    expect_true(is_rosv(osv_vulns("RSEC-2023-8", cache = FALSE)))

    expect_true(is_rosv(osv_vulns(c("RSEC-2023-8", "PYSEC-2021-387"), parse = FALSE)))
    expect_true(is_rosv(osv_vulns(c("RSEC-2023-8", "PYSEC-2021-387"), parse = TRUE)))
    expect_true(is_rosv(osv_vulns(c("RSEC-2023-8", "PYSEC-2021-387"), cache = TRUE)))
    expect_true(is_rosv(osv_vulns(c("RSEC-2023-8", "PYSEC-2021-387"), cache = FALSE)))

  })
})

Try the rosv package in your browser

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

rosv documentation built on May 29, 2024, 2:58 a.m.