summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
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 6c6faa5..f94f2d0 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):