Skip to content

Commit

Permalink
pkg vulns test added
Browse files Browse the repository at this point in the history
  • Loading branch information
al-obrien committed Nov 15, 2023
1 parent 07f99b4 commit b22e032
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"results": [
{
"vulns": [
{
"id": "PYSEC-2021-387",
"modified": "2021-11-11T13:06:47.756280Z"
}
]
},
{

}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"results": [
{
"vulns": [
{
"id": "RSEC-2023-2",
"modified": "2023-10-20T07:27:00.600Z"
}
]
},
{

}
]
}
6 changes: 6 additions & 0 deletions tests/testthat/test-query.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
with_mock_dir('is_pkg_vul', {
test_that("Returns named vectors with correct logic", {
expect_equal(is_pkg_vulnerable(c('dask', 'data.table'), c('PyPI', 'CRAN')), c(dask = TRUE, data.table = FALSE))
expect_equal(is_pkg_vulnerable(rep('readxl', 2), rep('CRAN', 2), version = c('1.4.1', '2.0.0')), c(readxl = TRUE, readxl = FALSE))
})
})

0 comments on commit b22e032

Please # to comment.