diff options
author | Gian Mario Tagliaretti <gianmt@gnome.org> | 2009-04-04 16:13:17 +0000 |
---|---|---|
committer | Gian Mario Tagliaretti <gianmt@src.gnome.org> | 2009-04-04 16:13:17 +0000 |
commit | 7193a0e14e488ef07f723a0b9f490a03fe291650 (patch) | |
tree | 8a8344c72c4708a5a4eac4885513e5e244dd4ba2 /tests | |
parent | 91733f750aaf4c53fdc198c56b61696f20f3ae20 (diff) | |
download | pygobject-7193a0e14e488ef07f723a0b9f490a03fe291650.tar.gz pygobject-7193a0e14e488ef07f723a0b9f490a03fe291650.tar.xz pygobject-7193a0e14e488ef07f723a0b9f490a03fe291650.zip |
Wrap new GFile methods.
2009-04-04 Gian Mario Tagliaretti <gianmt@gnome.org>
* 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
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_gio.py | 18 |
1 files changed, 18 insertions, 0 deletions
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() |