Skip to content

Commit

Permalink
Merge pull request #155 from subugoe/fix_154
Browse files Browse the repository at this point in the history
fixes #154 license check
  • Loading branch information
maxheld83 authored Feb 23, 2021
2 parents b10035a + 0ffc7bd commit 0f61ce7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
5 changes: 4 additions & 1 deletion R/cr_md_cc.R
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,10 @@ get_license_md <- function(cr) {
#'
get_compliant_cc <- function(license_df) {
license_df %>%
filter(# applies to version of record
filter(
# is cc
!is.na(.data$cc_norm),
# applies to version of record
.data$content.version == "vor",
# valid without delay
.data$delay.in.days == 0) %>%
Expand Down
8 changes: 6 additions & 2 deletions tests/testthat/test-cr-md_cc.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,16 @@ test_that("license md checker works (vor)",
vor_sample <- c(
"10.36900/suburban.v8i1/2.559",
"10.3389/fpsyg.2020.00097",
"10.1109/access.2020.2977087"
"10.1109/access.2020.2977087",
"10.1103/physrevlett.125.063601"
)
my_df <- get_cr_md(vor_sample)
out <- license_check(my_df)
# correct classes
checkmate::expect_tibble(out)

# correct dimensions
expect_equal(nrow(out), 3)
expect_equal(nrow(out), 4)

# correct validation
checkmate::checkString(unlist(
Expand All @@ -43,4 +44,7 @@ test_that("license md checker works (vor)",
checkmate::checkString(unlist(
out[out$doi == "10.1109/access.2020.2977087", "check_result"]),
"No Creative Commons license found")
checkmate::checkString(unlist(
out[out$doi == "10.1103/physrevlett.125.063601", "check_result"]),
"No Creative Commons license found")
})

0 comments on commit 0f61ce7

Please sign in to comment.