conduit r1189 - in trunk: scripts test/python-tests



Author: jstowers
Date: Fri Jan 11 01:56:30 2008
New Revision: 1189
URL: http://svn.gnome.org/viewvc/conduit?rev=1189&view=rev

Log:
Add non-interactive test switch

Modified:
   trunk/scripts/ListDBus.py
   trunk/scripts/run-tests.sh
   trunk/test/python-tests/TestDataProviderBoxDotNet.py
   trunk/test/python-tests/TestDataProviderFlickr.py
   trunk/test/python-tests/common.py

Modified: trunk/scripts/ListDBus.py
==============================================================================
--- trunk/scripts/ListDBus.py	(original)
+++ trunk/scripts/ListDBus.py	Fri Jan 11 01:56:30 2008
@@ -1,6 +1,5 @@
 #!/usr/bin/python
 import dbus
-from xml.dom import minidom
 
 obj = dbus.SessionBus().get_object('org.freedesktop.DBus', '/org/freedesktop/DBus') 
 dbus_iface = dbus.Interface(obj, 'org.freedesktop.DBus') 

Modified: trunk/scripts/run-tests.sh
==============================================================================
--- trunk/scripts/run-tests.sh	(original)
+++ trunk/scripts/run-tests.sh	Fri Jan 11 01:56:30 2008
@@ -21,6 +21,7 @@
     -d      Debug. also print test ouput to console\n\
     -D      Perform dataprovider tests\n\
     -S      Perform sync tests\n\
+    -N      Non interactive. Skip tests that require interaction (web login)\n\
 The operation of the script is affected by two environment\n\
 variables. TEST_USERNAME and TEST_PASSWORD are used as\n\
 login information in the relevant dataproviders\n\
@@ -42,7 +43,8 @@
 do_debug=0
 do_dataprovider_tests=0
 do_sync_tests=0
-while getopts "acus:odDS" options
+do_interactive="TRUE"
+while getopts "acus:odDSN" options
 do
     case $options in
         a )     do_auto=1;;
@@ -53,6 +55,7 @@
         d )     do_debug=1;;
         D )     do_dataprovider_tests=1;;
         S )     do_sync_tests=1;;
+        N )     do_interactive="FALSE";;
         \? )    echo -e $USAGE
                 exit 1;;
         * )     echo -e $USAGE
@@ -130,6 +133,7 @@
         COVERAGE_FILE="$LOGDIR/.coverage" \
         CONDUIT_LOGFILE=$logfile \
         CONDUIT_ONLINE=$do_online \
+        CONDUIT_INTERACTIVE=$do_interactive \
         python $EXEC
     else
         #run the test
@@ -137,6 +141,7 @@
         COVERAGE_FILE="$LOGDIR/.coverage" \
         CONDUIT_LOGFILE=$logfile \
         CONDUIT_ONLINE=$do_online \
+        CONDUIT_INTERACTIVE=$do_interactive \
         python $EXEC 2> /dev/null | \
         tee $tempfile
     fi

Modified: trunk/test/python-tests/TestDataProviderBoxDotNet.py
==============================================================================
--- trunk/test/python-tests/TestDataProviderBoxDotNet.py	(original)
+++ trunk/test/python-tests/TestDataProviderBoxDotNet.py	Fri Jan 11 01:56:30 2008
@@ -4,7 +4,7 @@
 import conduit.Utils as Utils
 import conduit.datatypes.File as File
 
-if not is_online():
+if not is_online() or not is_interactive():
     skip()
 
 #A Reliable file that will note be deleted

Modified: trunk/test/python-tests/TestDataProviderFlickr.py
==============================================================================
--- trunk/test/python-tests/TestDataProviderFlickr.py	(original)
+++ trunk/test/python-tests/TestDataProviderFlickr.py	Fri Jan 11 01:56:30 2008
@@ -10,7 +10,7 @@
 import conduit.datatypes.File as File
 import conduit.Utils as Utils
 
-if not is_online():
+if not is_online() or not is_interactive():
     skip()
 
 #A Reliable photo_id of a photo that will not be deleted

Modified: trunk/test/python-tests/common.py
==============================================================================
--- trunk/test/python-tests/common.py	(original)
+++ trunk/test/python-tests/common.py	Fri Jan 11 01:56:30 2008
@@ -91,7 +91,13 @@
         return os.environ["CONDUIT_ONLINE"] == "TRUE"
     except KeyError:
         return False
-
+        
+def is_interactive():
+    try:    
+        return os.environ["CONDUIT_INTERACTIVE"] == "TRUE"
+    except KeyError:
+        return False
+        
 def init_gnomevfs_authentication():
     import gnome.ui
     gnome.init(conduit.APPNAME, conduit.APPVERSION)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]