Skip to content

Commit

Permalink
test: check version
Browse files Browse the repository at this point in the history
  • Loading branch information
timcadman committed Jan 30, 2025
1 parent ec68f8d commit 5cc1c3d
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions tests/testthat/test-subset.R
Original file line number Diff line number Diff line change
Expand Up @@ -546,3 +546,47 @@ test_that(".add_slash_if_missing adds a slash to the end of the URL if not prese
)

})

test_that(".check_backend_version throws an error if version is below 4.7.1", {
info_from_api <- list(
build = list(
artifact = "molgenis-armadillo",
name = "molgenis-armadillo",
time = "2024-10-22T10:50:48.110Z",
version = "4.1.3",
group = "org.molgenis"
),
auth = list(
issuerUri = "https://lifecycle-auth.molgenis.org",
clientId = "b1b52e3c-4505-4326-993b-3d99df64ef6c"
)
)
expect_error(
with_mocked_bindings(
.check_backend_version(),
resp_body_json = function(armadillo_info){info_from_api}
)
)
})

test_that(".check_backend_version doesn't throw an error if version is equal or above 4.7.1", {
info_from_api <- list(
build = list(
artifact = "molgenis-armadillo",
name = "molgenis-armadillo",
time = "2024-10-22T10:50:48.110Z",
version = "4.7.1",
group = "org.molgenis"
),
auth = list(
issuerUri = "https://lifecycle-auth.molgenis.org",
clientId = "b1b52e3c-4505-4326-993b-3d99df64ef6c"
)
)
expect_silent(
with_mocked_bindings(
.check_backend_version(),
resp_body_json = function(armadillo_info){info_from_api}
)
)
})

0 comments on commit 5cc1c3d

Please sign in to comment.