File: module-install-venv

package info (click to toggle)
python3.9 3.9.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 102,508 kB
  • sloc: python: 606,145; ansic: 515,486; xml: 31,209; sh: 4,917; cpp: 3,781; makefile: 1,885; asm: 1,486; objc: 761; lisp: 502; pascal: 360; javascript: 177; csh: 11
file content (30 lines) | stat: -rwxr-xr-x 748 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/sh

cp -a debian/tests/packages "$AUTOPKGTEST_TMP"
HOME="$AUTOPKGTEST_TMP/home"
mkdir -p "$HOME"
python3.9 -m venv "$AUTOPKGTEST_TMP/ve"

VP="$AUTOPKGTEST_TMP/ve/bin/python"

testFibPy() {
	cd "$AUTOPKGTEST_TMP/packages/fibpy"
	$VP setup.py install
	assertTrue 'Install fibpy in a virtualenv' $?
	cd "$AUTOPKGTEST_TMP"
	stdout=$($VP -m fibpy 5)
	assertTrue 'Execute fibpy from a virtualenv' $?
	assertEquals 'Correct result' 8 "$stdout"
}

testFibC() {
	cd "$AUTOPKGTEST_TMP/packages/fibc"
	$VP setup.py install
	assertTrue 'Install fibc in a virtualenv' $?
	cd "$AUTOPKGTEST_TMP"
	stdout=$($VP -c 'from fibc import fib; print(fib(5))')
	assertTrue 'Execute fibc from a virtualenv' $?
	assertEquals 'Correct result' 8 "$stdout"
}

. shunit2