From 839192f14fc870045e30e90fd3de1ddc30d70dc0 Mon Sep 17 00:00:00 2001 From: HediaTnani Date: Tue, 16 Jan 2024 16:04:10 -0500 Subject: [PATCH] Add test to check if input is a rse Co-authored-by: Nick Eagles --- tests/testthat/test-getDegTx.R | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/testthat/test-getDegTx.R b/tests/testthat/test-getDegTx.R index 0236add..0657a50 100644 --- a/tests/testthat/test-getDegTx.R +++ b/tests/testthat/test-getDegTx.R @@ -52,4 +52,11 @@ test_that("getDegTx works with original and altered row names", { # Test for assayname not in assayNames test_that("getDegTx throws an error when assayname is not in assayNames", { expect_error(getDegTx(covComb_tx_deg, assayname = "not_in_assayNames"), "'not_in_assayNames' is not in assayNames\\(rse_tx\\).") -}) \ No newline at end of file +}) + +# Test for input is an rse object +test_that("getDegTx throws an error when input is not a RangedSummarizedExperiment object", { + qsv <- list(x = matrix(seq_len(9), ncol = 3)) + expect_error(getDegTx(qsv, assayname = "tpm"), "'rse_tx' must be a RangedSummarizedExperiment object.") +}) +