From 7193a0e14e488ef07f723a0b9f490a03fe291650 Mon Sep 17 00:00:00 2001 From: Gian Mario Tagliaretti Date: Sat, 4 Apr 2009 16:13:17 +0000 Subject: Wrap new GFile methods. 2009-04-04 Gian Mario Tagliaretti * gio/gfile.override: (_wrap_g_file_set_attributes_async) (_wrap_g_file_set_attributes_finish) Wrap new GFile methods. * tests/test_gio.py: Test the above methods. svn path=/trunk/; revision=1053 --- tests/test_gio.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'tests') diff --git a/tests/test_gio.py b/tests/test_gio.py index e308a2a..6c6faa5 100644 --- a/tests/test_gio.py +++ b/tests/test_gio.py @@ -404,6 +404,24 @@ class TestFile(unittest.TestCase): 10, gio.FILE_QUERY_INFO_NONE) self.assertEqual(ret, True) + def testSetAttributesAsync(self): + def callback(gfile, result): + try: + info = gfile.set_attributes_finish(result) + usec = info.get_attribute_uint32("time::modified-usec") + self.assertEqual(usec, 10) + finally: + loop.quit() + + info = gio.FileInfo() + info.set_attribute_uint32("time::modified-usec", 10) + + canc = gio.Cancellable() + self.file.set_attributes_async(info, callback) + + loop = glib.MainLoop() + loop.run() + def testReplaceContents(self): self.file.replace_contents("testing replace_contents") cont, leng, etag = self.file.load_contents() -- cgit