Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Testing shell script added for testing of python src (django mostly).

  • Loading branch information...
commit 7f23d0d17dcd5d764df2c7ed6b530498ae682c21 1 parent 38114d1
@clemesha-ooi clemesha-ooi authored
View
8 web/src/python/README
@@ -1,8 +0,0 @@
-TODO: should this file go here?
-
-
-Running tests
--------------
-
-Example: test only the "nimbus" app test:
- $ python nimbusweb/portal/manage.py test nimbus --pythonpath="."
View
2  web/src/python/nimbusweb/portal/settings.py
@@ -63,7 +63,7 @@
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
- #'cpserver',
+ 'cpserver',
'nimbusweb.portal.nimbus',
'nimbusweb.portal.usercreate',
)
View
26 web/src/python/run-tests.sh
@@ -0,0 +1,26 @@
+# Usage:
+#
+# $ ./run-tests.sh django-app-name-to-test
+#
+# If you do not specify an app name, all test will run.
+# TODO: let '--verbosity' be passed in as an argument.
+#
+PYTHON_EXE="/usr/bin/env python"
+
+NIMBUS_WEBDIR_REL="`dirname $0`/../.."
+NIMBUS_WEBDIR=`cd $NIMBUS_WEBDIR_REL; pwd`
+
+NIMBUS_WEBCONF="$NIMBUS_WEBDIR/nimbusweb.conf"
+if [ ! -f "$NIMBUS_WEBCONF" ]; then
+ echo ""
+ echo "Cannot find conf file, exiting. (expected at '$NIMBUS_WEBCONF')"
+ exit 1
+fi
+
+NIMBUS_PYLIB="$NIMBUS_WEBDIR/lib/python"
+NIMBUS_PYSRC="$NIMBUS_WEBDIR/src/python"
+
+PYTHONPATH="$NIMBUS_PYSRC:$NIMBUS_PYLIB:$PYTHONPATH"
+export PYTHONPATH
+
+$PYTHON_EXE $NIMBUS_PYSRC/nimbusweb/portal/manage.py test --verbosity=2 $1
Please sign in to comment.
Something went wrong with that request. Please try again.