File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bats
2+
3+ TEST_DIR=" $( pwd) /python_venv_failure"
4+
5+ # create an arbitrary executable for the target to find
6+ function setup() {
7+ rm -rf " $TEST_DIR "
8+ mkdir -p " ${TEST_DIR} /venv/bin" " ${TEST_DIR} /user/.local/bin"
9+ touch " ${TEST_DIR} /venv/bin/test.bat"
10+ chmod +x " ${TEST_DIR} /venv/bin/test.bat"
11+ }
12+
13+ @test " python/venv: failure" {
14+ # If the executable is not found, the target will exit 2
15+ run make guard/program/test.bat
16+ [ " $status " -eq 2 ]
17+ [[ " $output " == * " No rule to make target 'test.bat/install" * ]]
18+ }
19+
20+ function teardown() {
21+ rm -rf " $TEST_DIR "
22+ }
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bats
2+
3+ TEST_DIR=" $( pwd) /python_venv_success"
4+
5+ # create an arbitrary executable for the target to find
6+ function setup() {
7+ rm -rf " $TEST_DIR "
8+ mkdir -p " ${TEST_DIR} /venv/bin" " ${TEST_DIR} /user/.local/bin"
9+ touch " ${TEST_DIR} /venv/bin/test.bat"
10+ chmod +x " ${TEST_DIR} /venv/bin/test.bat"
11+ export VIRTUAL_ENV=" ${TEST_DIR} /venv"
12+ export PYTHONUSERBASE=" ${TEST_DIR} /user/.local"
13+ }
14+
15+ @test " python/venv: success" {
16+ # If the executable is found, the target will exit 0
17+ run make guard/program/test.bat
18+ [ " $status " -eq 0 ]
19+ }
20+
21+ function teardown() {
22+ rm -rf " $TEST_DIR "
23+ }
You can’t perform that action at this time.
0 commit comments