Skip to content

Commit 9eb457c

Browse files
committed
improved tests
1 parent 61b7de2 commit 9eb457c

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

tests/get_container.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import sys
2+
sys.path.append("../")
3+
sys.path.append("../../")
4+
import cw_common
5+
print(cw_common.get_docker_image('/etc/os-release')[1])

tests/setup.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ else
3333
export _NC=""
3434
fi
3535

36+
_msg(){
37+
echo -en "[ - ] $1\r"
38+
}
39+
3640
_ok (){
3741
echo -e "[ ${_GREEN}OK${_NC} ] $1"
3842

@@ -43,6 +47,7 @@ _fail(){
4347

4448

4549
t_run(){
50+
_msg "$2"
4651
eval "$1" &>>test.log
4752
if [[ $? -eq 0 ]];then
4853
_ok "$2"

tests/test-03.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ Gdal/bin/python -m venv Py
6565
t_run 'Py/bin/python -c "import sys;import os;sys.exit(\"CONDA_PREFIX\" in os.environ)"' "Conda is not active in venv"
6666
export CW_FORCE_CONDA_ACTIVATE=1
6767
t_run 'Py/bin/python -c "import sys;import os;sys.exit(\"CONDA_PREFIX\" not in os.environ)"' "Conda can be activated in venv"
68+
t_run 'Py/bin/python -c "import os;import shutil;import sys;sys.exit(shutil.which(\"python3\") != os.getcwd()+\"/Py/bin/python3\" )"' "Venv path is first even if conda is active"
6869
unset CW_FORCE_CONDA_ACTIVATE
6970
unset CW_EXTRA_BIND_MOUNTS
7071
mkdir -p M MyProg/bin N

0 commit comments

Comments
 (0)