summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGian Mario Tagliaretti <gianmt@gnome.org>2009-04-05 19:06:54 +0000
committerGian Mario Tagliaretti <gianmt@src.gnome.org>2009-04-05 19:06:54 +0000
commit82e18dfab3270e5ca972491be2d50d6b3b85f975 (patch)
treecfb5eeb387a1324c6e7da52013bcced3842f9f4d /tests
parent14a6cda08733771ea748fb8c7e4c885244944b6b (diff)
downloadpygobject-82e18dfab3270e5ca972491be2d50d6b3b85f975.tar.gz
Wrap new GFile method.
2009-04-05 Gian Mario Tagliaretti <gianmt@gnome.org> * gio/gfile.override: (_wrap_g_file_set_display_name_async) Wrap new GFile method. * tests/test_gio.py: Test the above methods. svn path=/trunk/; revision=1056
Diffstat (limited to 'tests')
-rw-r--r--tests/test_gio.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test_gio.py b/tests/test_gio.py
index 6c6faa58..f94f2d0d 100644
--- a/tests/test_gio.py
+++ b/tests/test_gio.py
@@ -472,6 +472,22 @@ class TestFile(unittest.TestCase):
self.assertEquals(hash(gio.File('foo')),
hash(gio.File('foo')))
+ def testSetDisplayNameAsync(self):
+ def callback(gfile, result):
+ try:
+ new_gfile = gfile.set_display_name_finish(result)
+ new_name = new_gfile.get_basename()
+ self.assertEqual(new_name, "new.txt")
+ deleted = new_gfile.delete()
+ self.assertEqual(deleted, True)
+ finally:
+ loop.quit()
+
+ canc = gio.Cancellable()
+ self.file.set_display_name_async("new.txt", callback, cancellable=canc)
+
+ loop = glib.MainLoop()
+ loop.run()
class TestGFileEnumerator(unittest.TestCase):
def setUp(self):