File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11test_that(" find_python returns a valid path" , {
22 testthat :: skip_on_cran()
3-
43 python_path <- Sys.which(" python3" )
5-
64 if (python_path == " " ) {
75 python_path <- Sys.which(" python" )
86 }
9-
107 expect_true(python_path != " " )
118})
129
1310test_that(" install_acro function exists and is callable" , {
1411 testthat :: skip_on_cran()
15-
1612 expect_true(is.function(install_acro ))
1713})
1814
1915test_that(" create_virtualenv function exists and is callable" , {
2016 testthat :: skip_on_cran()
21-
2217 expect_true(is.function(create_virtualenv ))
2318})
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- })
You can’t perform that action at this time.
0 commit comments