Skip to content

Commit

Permalink
Add tests for data
Browse files Browse the repository at this point in the history
  • Loading branch information
Bisaloo committed Nov 27, 2024
1 parent 7b5ee09 commit 3ca224d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ RoxygenNote: 7.3.2
Depends:
R (>= 2.10)
Suggests:
jsonlite,
pkgmatch,
testthat (>= 3.0.0)
Config/testthat/edition: 3
Expand Down
10 changes: 10 additions & 0 deletions tests/testthat/test-data.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
test_that("epi_embeddings data format", {

epi_pkgs <- jsonlite::fromJSON("https://epiverse-connect.r-universe.dev/api/ls")

# Not expect_setequal() because pkgmatch will ignore pkgs that do not parse
expect_in(colnames(epi_embeddings$text_with_fns), epi_pkgs)
expect_in(colnames(epi_embeddings$text_wo_fns), epi_pkgs)
expect_in(colnames(epi_embeddings$code), epi_pkgs)

})
3 changes: 3 additions & 0 deletions tests/testthat/test-queries.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

test_that("test queries return expected output", {

# Since ollama is not installed
skip_on_ci()

# Simple cases
expect_true(
any(
Expand Down

0 comments on commit 3ca224d

Please sign in to comment.