Skip to content

Commit

Permalink
Graph attributes should only be checked when Rgraphviz is installed
Browse files Browse the repository at this point in the history
  • Loading branch information
kkholst committed Dec 9, 2023
1 parent ce96f3b commit c1e2665
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/testthat/test-model.R
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ test_that("Linear constraints", {
})


if (requireNamespace("graph",quietly = TRUE))
if (requireNamespace("Rgraphviz",quietly = TRUE))
test_that("Graph attributes", {
m <- lvm(y~x)
suppressMessages(g1 <- graph::updateGraph(plot(m,noplot=TRUE)))
Expand All @@ -93,8 +93,9 @@ test_that("Graph attributes", {
g1 <- lava::addattr(g1, "fill", v, col)
testthat::expect_true(col == graph::nodeRenderInfo(g1)$fill[[v]])
nodecolor(m, v) <- "blue"

g2 <- Graph(m, add=TRUE)
testthat::expect_true(inherits(g2,"graph"))
testthat::expect_true(inherits(g2, "graph"))
testthat::expect_true(col == graph::nodeRenderInfo(g2)$fill[[v]])
testthat::expect_true(addattr(g2, "fill")[[v]] == "blue")
graph::graphRenderInfo(g2)$rankdir <- "LR"
Expand Down

0 comments on commit c1e2665

Please sign in to comment.