Commit 408cf440 authored by David's avatar David
Browse files

test(plot.GRiwrm): add test for a single node network

Refs #153
parent f86ef48d
No related merge requests found
Pipeline #57020 failed with stage
in 10 minutes and 2 seconds
Showing with 8 additions and 1 deletion
+8 -1
...@@ -11,7 +11,7 @@ test_that("Diverted ungauged nodes have correct color", { ...@@ -11,7 +11,7 @@ test_that("Diverted ungauged nodes have correct color", {
expect_true(any(grepl("id_54029 UpstreamUngaugedDiversion", strsplit(mmd, "\n\n")[[1]]))) expect_true(any(grepl("id_54029 UpstreamUngaugedDiversion", strsplit(mmd, "\n\n")[[1]])))
}) })
test_that("Unguaged nodes and donors are in a box!", { test_that("Ungauged nodes and donors are in a box!", {
nds <- loadSevernNodes() nds <- loadSevernNodes()
nds$donor <- as.character(NA) nds$donor <- as.character(NA)
nds$model[nds$id %in% c("54001", "54032", "54029")] <- "Ungauged" nds$model[nds$id %in% c("54001", "54032", "54029")] <- "Ungauged"
...@@ -23,3 +23,10 @@ test_that("Unguaged nodes and donors are in a box!", { ...@@ -23,3 +23,10 @@ test_that("Unguaged nodes and donors are in a box!", {
s <- plot(g, display = FALSE) s <- plot(g, display = FALSE)
expect_equal(strsplit(s, "\n")[[1]][c(5,13)], c("subgraph donor_54095 [54095]", "end")) expect_equal(strsplit(s, "\n")[[1]][c(5,13)], c("subgraph donor_54095 [54095]", "end"))
}) })
test_that("Single node plot does not crash", {
sgl_node <- loadSevernNodes()[1,]
g <- CreateGRiwrm(sgl_node)
mmd <- plot(g, display = FALSE)
expectfalse(grepl("-->", mmd, fixed = TRUE))
})
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment