Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: enviPathR
Title: Client for the 'enviPath' 'RESTful' API
Version: 1.0.0
Version: 1.0.1
Authors@R:
c(person(given = "Giulio", family = "Benedetti",
role = c("aut", "cre", "cph"),
Expand Down
10 changes: 5 additions & 5 deletions tests/httptest/get/package_reaction/wrong.R

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions tests/httptest/link/package_compound/wrong.R

Large diffs are not rendered by default.

120 changes: 60 additions & 60 deletions tests/httptest/list/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,65 @@
{
"package": [
{
"description": "Package to make Prediction Models publicly available",
"id": "https://envipath.org/package/134886bb-b52e-4ad6-91d3-a02cecde6d95",
"links": [
{
"Pathways": [
"https://envipath.org/package_pathway",
0
]
},
{
"Rules": [
"https://envipath.org/package_rule",
0
]
},
{
"Compounds": [
"https://envipath.org/package_compound",
0
]
},
{
"Reactions": [
"https://envipath.org/package_reaction",
0
]
},
{
"Relative Reasoning": [
"https://envipath.org/package_relative-reasoning",
5
]
},
{
"Scenarios": [
"https://envipath.org/package_scenario",
0
]
}
],
"name": "Public Prediction Models",
"primaryGroup": null,
"readers": [
{
"id": "https://envipath.org/user/fce36893-bdb1-4a6f-87bd-5fd893feca89",
"identifier": "user",
"name": "admin"
}
],
"reviewComment": "",
"reviewStatus": "reviewed",
"writers": [
{
"id": "https://envipath.org/user/fce36893-bdb1-4a6f-87bd-5fd893feca89",
"identifier": "user",
"name": "admin"
}
]
},
{
"description": "This Package was generated automatically for the batch prediction task.",
"id": "https://envipath.org/package/5b594bf6-56a8-4ce5-9a63-5fd4b525756e",
Expand Down Expand Up @@ -360,66 +420,6 @@
}
]
},
{
"description": "Package to make Prediction Models publicly available",
"id": "https://envipath.org/package/134886bb-b52e-4ad6-91d3-a02cecde6d95",
"links": [
{
"Pathways": [
"https://envipath.org/package_pathway",
0
]
},
{
"Rules": [
"https://envipath.org/package_rule",
0
]
},
{
"Compounds": [
"https://envipath.org/package_compound",
0
]
},
{
"Reactions": [
"https://envipath.org/package_reaction",
0
]
},
{
"Relative Reasoning": [
"https://envipath.org/package_relative-reasoning",
3
]
},
{
"Scenarios": [
"https://envipath.org/package_scenario",
0
]
}
],
"name": "Public Prediction Models",
"primaryGroup": null,
"readers": [
{
"id": "https://envipath.org/user/fce36893-bdb1-4a6f-87bd-5fd893feca89",
"identifier": "user",
"name": "admin"
}
],
"reviewComment": "",
"reviewStatus": "reviewed",
"writers": [
{
"id": "https://envipath.org/user/fce36893-bdb1-4a6f-87bd-5fd893feca89",
"identifier": "user",
"name": "admin"
}
]
},
{
"description": "string",
"id": "https://envipath.org/package/7245f711-51d0-4b1e-b49d-99a9d9744c96",
Expand Down
10 changes: 5 additions & 5 deletions tests/httptest/list/package/wrong/reaction.R

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions tests/httptest/login/NA-2f7c1a-POST.R

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions tests/httptest/model/util-e1f28b-POST.R
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
structure(list(method = "POST", url = "https://util", status_code = 403L,
headers = structure(list(Server = "nginx/1.24.0 (Ubuntu)",
Date = "Thu, 01 Oct 2026 02:05:34 GMT", `Content-Type` = "application/json; charset=utf-8",
Date = "Fri, 16 Oct 2026 03:48:10 GMT", `Content-Type` = "application/json; charset=utf-8",
`Content-Length` = "139", Connection = "keep-alive",
Vary = "Authorization, Cookie", `X-Frame-Options` = "DENY",
`X-Content-Type-Options` = "nosniff", `Referrer-Policy` = "same-origin",
`Cross-Origin-Opener-Policy` = "same-origin"), class = "httr2_headers"),
body = charToRaw("{\"message\": \"Getting Setting with id https://envipath.org/setting/1d915a48-286a-4394-9693-bfaa187326a5 failed due to insufficient rights!\"}"),
timing = c(redirect = 0, namelookup = 3.1e-05, connect = 0,
pretransfer = 0.000165, starttransfer = 0.247818, total = 0.247872
timing = c(redirect = 0, namelookup = 3.2e-05, connect = 0,
pretransfer = 0.000166, starttransfer = 0.347267, total = 0.347304
), cache = new.env(parent = emptyenv())), class = "httr2_response")
2 changes: 2 additions & 0 deletions tests/testthat/setup.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@

library(httptest2)
# Set serial strategy
BPPARAM <- BiocParallel::SerialParam()
# Retrieve login credentials
username <- Sys.getenv("EP_USERNAME")
password <- Sys.getenv("EP_PASSWORD")
Expand Down
8 changes: 4 additions & 4 deletions tests/testthat/test-get.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ with_mock_dir("../httptest/get", {
rxn_id <- "2b6bbcc5-77f4-4bed-92a9-731cdc978f6a"

expect_error(
epGet("wrong"),
epGet("wrong", BPPARAM = BPPARAM),
"'type' must be one of the listable elements returned by epTypes.",
fixed = TRUE
)

expect_error(
epGet("reaction", "wrong"),
epGet("reaction", "wrong", BPPARAM = BPPARAM),
"Not found. Please check that 'type' and 'pkg' are correct.",
fixed = TRUE
)

rxn <- epGet("reaction", rxn_id)
rxn <- epGet("reaction", rxn_id, BPPARAM = BPPARAM)

expect_type(rxn, "list")
expect_length(rxn, 15L)
})
})
})
6 changes: 3 additions & 3 deletions tests/testthat/test-link.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ with_mock_dir("../httptest/link", {
cpd_id <- "ec87b463-6a3c-4dfa-8b88-4637fc158896"

expect_error(
epLink("wrong", types[2], cpd_id),
epLink("wrong", types[2], cpd_id, BPPARAM = BPPARAM),
"'from' must be one of the linkable elements returned by epTypes.",
fixed = TRUE
)

expect_error(
epLink(types[1], types[2], "wrong"),
epLink(types[1], types[2], "wrong", BPPARAM = BPPARAM),
"Not found. Please check that 'type' and 'pkg' are correct.",
fixed = TRUE
)

cpd2inchikey <- epLink(types[1], types[2], cpd_id)
cpd2inchikey <- epLink(types[1], types[2], cpd_id, BPPARAM = BPPARAM)

expect_named(cpd2inchikey, types)
})
Expand Down
Loading