-
Notifications
You must be signed in to change notification settings - Fork 38
/
run.sh
executable file
·42 lines (38 loc) · 971 Bytes
/
run.sh
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
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
export PYTHONPATH=".:$PYTHONPATH"
export DJANGO_SETTINGS_MODULE="test_settings"
PROG="$0"
CMD="$1"
shift
usage() {
echo "USAGE: $PROG [command]"
echo " test - run the jsonview tests"
echo " shell - open the Django shell"
echo " check - run flake8"
echo " coverage - run tests with coverage"
exit 1
}
case "$CMD" in
"test" )
echo "Django version: $(python -m django --version)"
python -m django test jsonview "$@"
;;
"shell" )
python -m django shell "$@"
;;
"check" )
echo "Flake8 version: $(flake8 --version)"
flake8 jsonview "$@"
;;
"coverage" )
echo "Django version: $(python -m django --version)"
coverage3 run -m django test jsonview "$@"
coverage3 report \
-m \
--include=jsonview/* \
--omit=jsonview/tests.py \
--fail-under=100
;;
* )
usage ;;
esac