summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGian Mario Tagliaretti <gianmt@src.gnome.org>2008-07-29 21:51:43 +0000
committerGian Mario Tagliaretti <gianmt@src.gnome.org>2008-07-29 21:51:43 +0000
commit35bf67dec117effae2512c0715d0dea15425d23f (patch)
tree749571c894c945cf7018fca2562c26dc78d10f8e /tests
parenta831d7702e12e014f7396ee0348159c5361083d2 (diff)
downloadpygobject-35bf67dec117effae2512c0715d0dea15425d23f.tar.gz
Wrap new object gio.FileAttributeInfo, g_file_set_attribute and g_file_query_settable_attributes methods.
svn path=/trunk/; revision=901
Diffstat (limited to 'tests')
-rw-r--r--tests/test_gio.py25
1 files changed, 24 insertions, 1 deletions
diff --git a/tests/test_gio.py b/tests/test_gio.py
index 92ffb479..4acb3877 100644
--- a/tests/test_gio.py
+++ b/tests/test_gio.py
@@ -159,6 +159,30 @@ class TestFile(unittest.TestCase):
finally:
os.unlink("copy.txt")
+ def testInfoList(self):
+ infolist = self.file.query_settable_attributes()
+ for info in infolist:
+ if info.name == "time::modified":
+ self.assertEqual(info.type, gio.FILE_ATTRIBUTE_TYPE_UINT64)
+ self.assertEqual(info.name, "time::modified")
+ self.assertEqual(info.flags,
+ gio.FILE_ATTRIBUTE_INFO_COPY_WHEN_MOVED)
+
+ def testSetAttribute(self):
+ self._f.write("testing attributes")
+ self._f.seek(0)
+ infolist = self.file.query_settable_attributes()
+
+ self.assertNotEqual(len(infolist), 0)
+
+ for info in infolist:
+ if info.name == "time::modified-usec":
+ ret = self.file.set_attribute("time::modified-usec",
+ gio.FILE_ATTRIBUTE_TYPE_UINT32,
+ 10, gio.FILE_QUERY_INFO_NONE)
+ self.assertEqual(ret, True)
+
+
class TestGFileEnumerator(unittest.TestCase):
def setUp(self):
self.file = gio.File(".")
@@ -419,4 +443,3 @@ class TestAppInfo(unittest.TestCase):
def testSimple(self):
self.assertEquals(self.appinfo.get_description(),
"Custom definition for does-not-exist")
-