Symlink all app static files to test dir

This commit is contained in:
Ben Busby 2021-03-18 10:44:29 -04:00
parent 9832c6191a
commit c429046c0d
No known key found for this signature in database
GPG Key ID: 3B08611DF6E62ED2

5
run
View File

@ -12,12 +12,13 @@ SUBDIR="${1:-app}"
export APP_ROOT="$SCRIPT_DIR/$SUBDIR"
export STATIC_FOLDER="$APP_ROOT/static"
mkdir -p "$STATIC_FOLDER"
# Check for regular vs test run
if [[ "$SUBDIR" == "test" ]]; then
# Set up static files for testing
ln -s "$SCRIPT_DIR/app/static" "$STATIC_FOLDER"
pytest -sv
else
mkdir -p "$STATIC_FOLDER"
python3 -um app \
--host "${ADDRESS:-0.0.0.0}" \
--port "${PORT:-"${EXPOSE_PORT:-5000}"}"