Skip to content

Commit 64a52f0

Browse files
committed
Merge branch 'main' of https://github.com/JessUWE/ACRO-R
2 parents 8e1b6d2 + 437d224 commit 64a52f0

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

tests/testthat/test-create_virtualenv.R

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,25 @@ test_that("create_virtualenv function exists and is callable", {
2121

2222
expect_true(is.function(create_virtualenv))
2323
})
24+
25+
test_that("install_acro stops when python not found", {
26+
# Mock Sys.which to return empty string (simulates Python not installed)
27+
with_mock(
28+
`base::Sys.which` = function(x) "",
29+
expect_error(
30+
install_acro(envname = "test-env", python = NULL),
31+
"Python not found in PATH"
32+
)
33+
)
34+
})
35+
36+
test_that("create_virtualenv stops when python not found", {
37+
# Mock Sys.which to return empty string
38+
with_mock(
39+
`base::Sys.which` = function(x) "",
40+
expect_error(
41+
create_virtualenv(),
42+
"Python not found in PATH"
43+
)
44+
)
45+
})

0 commit comments

Comments
 (0)