conduit r1759 - in trunk: . conduit/datatypes test/python-tests test/python-tests/data



Author: jstowers
Date: Tue Oct  7 22:31:47 2008
New Revision: 1759
URL: http://svn.gnome.org/viewvc/conduit?rev=1759&view=rev

Log:
2008-10-08  John Stowers  <john stowers gmail com>

	* conduit/datatypes/File.py: get_removable_volume_root_uri and 
	is_on_removale_volume are called but not implemented.
	Fixes #555403 (Luca Ognibene)

	* test/python-tests/TestCoreFile.py:
	* test/python-tests/data/folder.list: Add tests for the above



Modified:
   trunk/ChangeLog
   trunk/conduit/datatypes/File.py
   trunk/test/python-tests/TestCoreFile.py
   trunk/test/python-tests/data/folder.list

Modified: trunk/conduit/datatypes/File.py
==============================================================================
--- trunk/conduit/datatypes/File.py	(original)
+++ trunk/conduit/datatypes/File.py	Tue Oct  7 22:31:47 2008
@@ -356,6 +356,12 @@
             return self.to_tempfile()
         else:
             return path
+
+    def get_removable_volume_root_uri(self):
+        return self._file.get_removable_volume_root_uri()
+
+    def is_on_removale_volume(self):
+        return self._file.is_on_removale_volume()
             
     def get_relative_uri(self):
         """

Modified: trunk/test/python-tests/TestCoreFile.py
==============================================================================
--- trunk/test/python-tests/TestCoreFile.py	(original)
+++ trunk/test/python-tests/TestCoreFile.py	Tue Oct  7 22:31:47 2008
@@ -12,7 +12,8 @@
 import tempfile
 
 #for impl in ("GIO",):
-for impl in ("GIO","GnomeVfs"):
+#for impl in ("GnomeVfs",):
+for impl in ("GIO", "GnomeVfs"):
     ok("--- TESTING FILE IMPL: %s" % impl, True)
 
     try:
@@ -49,6 +50,12 @@
     contents = temp.get_contents_as_text()
     ok("Base: wrote contents again", contents == "456")
 
+    remUri = get_external_resources('folder')['removable-volume']
+    rf = File.File(remUri,implName=impl)
+    if Vfs.uri_exists(remUri):
+        ok("Base: Removable volume detected", rf.is_on_removale_volume() == True)
+        ok("Base: Removable volume calculate root path", rf.get_removable_volume_root_uri() == remUri)
+
     folder = File.File(os.environ["HOME"],implName=impl)
     ok("Base: check if HOME exists", folder.exists() == True)
     ok("Base: check if HOME is folder", folder.is_directory() == True)

Modified: trunk/test/python-tests/data/folder.list
==============================================================================
--- trunk/test/python-tests/data/folder.list	(original)
+++ trunk/test/python-tests/data/folder.list	Tue Oct  7 22:31:47 2008
@@ -18,3 +18,7 @@
 removable-volume=file:///media/sda2/dell
 ntfs-volume=file:///media/sda2
 
+[john nzjrs-laptop]
+removable-volume=file:///media/JRS89
+ntfs-volume=file:///media/disk
+



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