Skip to content

Commit

Permalink
zenodo all_versions bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
Carl Boettiger committed Apr 21, 2023
1 parent 3ca3c3b commit b90eb88
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: contentid
Version: 0.0.16
Version: 0.0.17
Title: An Interface for Content-Based Identifiers
Description: An interface for creating, registering, and resolving content-based
identifiers for data management. Content-based identifiers rely on
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# contentid 0.0.17

- bugfix for Zenodo resolver to search all versions

- bugfix for local cache / content store handling of hashes other than SHA-256

- software heritage is no longer a default registry. SWH imposes rate
limiting of 120 calls, and so should not be pinged if not expected as a registry.

Expand Down
2 changes: 1 addition & 1 deletion R/zenodo_registry.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ sources_zenodo <- function(id, host = "https://zenodo.org"){
}

checksum <- paste0('"', algo, ":", hash, '"')
url <- paste0(host, query, checksum)
url <- paste0(host, query, checksum, '&all_versions=1')

sources <- tryCatch({
resp <- httr::GET(url)
Expand Down
16 changes: 16 additions & 0 deletions tests/testthat/test-zenodo.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

context("Zenodo")


test_that("we can return sources from Zenodo", {

skip_if_offline()
skip_on_cran()

id <- paste0("hash://md5/61b36a86930f6ffb073f4e189bbd5723")
df <- sources_zenodo(id)
expect_is(df, "data.frame")
expect_gt(nrow(df), 0)

})

0 comments on commit b90eb88

Please sign in to comment.