conduit r1820 - in trunk: . scripts test/python-tests



Author: jstowers
Date: Tue Jan 20 02:21:46 2009
New Revision: 1820
URL: http://svn.gnome.org/viewvc/conduit?rev=1820&view=rev

Log:
2009-01-20  John Stowers  <john stowers gmail com>

	* test/python-tests/TestCoreFile.py: Add filesize 
	test to TestCoreFile.py. Make is_local not fatal

	* scripts/run-tests.sh: use 'mktemp'
	instead of 'tempfile'. Patch by Brian Teague



Modified:
   trunk/ChangeLog
   trunk/scripts/run-tests.sh
   trunk/test/python-tests/TestCoreFile.py

Modified: trunk/scripts/run-tests.sh
==============================================================================
--- trunk/scripts/run-tests.sh	(original)
+++ trunk/scripts/run-tests.sh	Tue Jan 20 02:21:46 2009
@@ -120,7 +120,11 @@
 
 #test results go to index.html
 indexfile=$LOGDIR/index.html
-tempfile=`tempfile`
+if [ -e '/bin/tempfile' ] ; then
+    tempfile=`tempfile`
+else
+    tempfile=`mktemp`
+fi
 
 echo $HEADER > $indexfile
 echo $STYLE >> $indexfile

Modified: trunk/test/python-tests/TestCoreFile.py
==============================================================================
--- trunk/test/python-tests/TestCoreFile.py	(original)
+++ trunk/test/python-tests/TestCoreFile.py	Tue Jan 20 02:21:46 2009
@@ -53,6 +53,11 @@
     contents = temp.get_contents_as_text()
     ok("Base: wrote contents again", contents == "456")
 
+    tempsize = random.randint(100, 200)
+    contents = "a"*tempsize
+    temp.set_contents_as_text(contents)
+    ok( "Base: file size is accurate", temp.get_size() == tempsize )
+
     remUri = get_external_resources('folder')['removable-volume']
     rf = File.File(remUri,implName=impl)
     if Vfs.uri_exists(remUri):
@@ -79,7 +84,8 @@
         f = File.File(i,implName=impl)
         ok("Local: %s exists" % i, f.exists())
         remote = f.is_local() == 1
-        ok("Local: is local = %s" % remote,remote)
+        # these might not be local, we might be on nfs after all!
+        ok("Local: is local = %s" % remote,remote,die=False)
         mime = f.get_mimetype()
         ok("Local: file mimetype = %s" % mime,type(mime) == str and len(mime) > 0)
         mtime = f.get_mtime()        



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