Skip to content

Commit 34f43a8

Browse files
committed
tests
1 parent 6d84814 commit 34f43a8

File tree

4 files changed

+16
-7
lines changed

4 files changed

+16
-7
lines changed

R/parse_cli_params.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -440,8 +440,8 @@ parse_cli_params <- function(arguments, parameters) {
440440
if (!is.null(arguments$force)) {
441441
parameters$options$force <- as.logical(arguments$force)
442442
}
443-
if (!is.null(arguments$nit_rule)) {
444-
parameters$options$nitrogen_rule <- as.logical(arguments$nit_rule)
443+
if (!is.null(arguments$nit_rul)) {
444+
parameters$options$nitrogen_rule <- as.logical(arguments$nit_rul)
445445
}
446446
if (!is.null(arguments$summarise)) {
447447
parameters$options$summarise <- as.logical(arguments$summarise)

R/prepare_params.R

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,11 +187,10 @@ prepare_params <- function(params_small = get_params(step = "prepare_params"),
187187
if (!is.null(org_tax)) {
188188
if (org_tax == "") {
189189
org_tax <- NULL
190+
} else {
191+
fil_met_raw <- NULL
190192
}
191193
}
192-
if (!is.null(org_tax)) {
193-
fil_met_raw <- NULL
194-
}
195194

196195
log_debug(x = "Changing params")
197196
switch(step,

codemeta.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@
513513
"SystemRequirements": null
514514
},
515515
"keywords": ["metaboliteannotation", "chemotaxonomy", "scoringsystem", "naturalproducts", "computationalmetabolomics", "taxonomicdistance", "specializedmetabolome"],
516-
"fileSize": "2850.662KB",
516+
"fileSize": "2840.261KB",
517517
"citation": [
518518
{
519519
"@type": "ScholarlyArticle",

tests/testthat/test_functions.R

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ testthat::test_that("Test functions", {
1717
## Prepare config for a single step only
1818
prepare_params(step = "weight_annotations")
1919
## For all steps
20-
prepare_params()
20+
params$organisms$taxon <- ""
21+
prepare_params(params_small = params)
22+
params$organisms$taxon <- "Gentiana lutea"
23+
prepare_params(params_small = params)
2124
prepare_params(step = "annotate_masses")
2225
prepare_params(step = "annotate_spectra")
2326
prepare_params(step = "create_components")
@@ -293,6 +296,8 @@ testthat::test_that("Test functions", {
293296
)
294297
#### Classical
295298
prepare_libraries_spectra()
299+
#### Again
300+
prepare_libraries_spectra()
296301

297302
## for msp reading test
298303
import_spectra(dir(system.file("extdata", package = "MsBackendMsp"), full.names = TRUE, pattern = "msp$")[1L])
@@ -641,6 +646,11 @@ testthat::test_that("Test functions", {
641646
arguments$nit_rul <- "x"
642647
arguments$summarise <- "x"
643648

649+
# Useless
650+
keep_peaks(x = 0, prop = 0)
651+
normalize_peaks()
652+
remove_above_precursor()
653+
644654
parse_cli_params(
645655
arguments = arguments,
646656
parameters = params

0 commit comments

Comments
 (0)