-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
13 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
CRAN_PACKAGE_DB <- kwb.package:::getCranPackageDatabase() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,18 @@ | ||
# | ||
# This file was generated by kwb.test::create_test_files(), | ||
# launched by hsonne on 2024-05-02 17:58:28. | ||
# Please modify the dummy functions so that real cases are | ||
# tested. Then, delete this comment. | ||
# | ||
#library(testthat) | ||
#source("tests/testthat/setup.R") | ||
|
||
test_that("getPackageLicences() works", { | ||
|
||
f <- kwb.package::getPackageLicences | ||
|
||
expect_error( | ||
f() | ||
# Argument "packages" fehlt (ohne Standardwert) | ||
) | ||
expect_error(f()) | ||
|
||
# CRAN_PACKAGE_DB is loaded in testthat/setup.R | ||
result <- f("kwb.utils", db = CRAN_PACKAGE_DB) | ||
|
||
expect_true(nrow(result) == 1L) | ||
expect_true(all(is.na(kwb.utils::removeColumns(result, c("package", "licence"))))) | ||
expect_identical(result$licence, "<not_found>") | ||
|
||
expect_identical(f("dplyr")$package, "dplyr") | ||
}) |