summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJohan Dahlin <johan@gnome.org>2008-07-18 22:38:29 +0000
committerJohan Dahlin <johan@src.gnome.org>2008-07-18 22:38:29 +0000
commit7213af80481a6bc12588a5e74944b5c47ec30df4 (patch)
treefaec25fa19bfb68b1b2e811af1bdb204bc6686f8 /tests
parent4bea3e15b5aa3aaf42986c9e8fd50d4850f50a59 (diff)
downloadpygobject-7213af80481a6bc12588a5e74944b5c47ec30df4.tar.gz
pygobject-7213af80481a6bc12588a5e74944b5c47ec30df4.tar.xz
pygobject-7213af80481a6bc12588a5e74944b5c47ec30df4.zip
Wrap gio.FileEnumerator.next_files_async/next_files_done. Update the
2008-07-19 Johan Dahlin <johan@gnome.org> * examples/gio/directory-async.py: * gio/gfileenumerator.override: * gio/gio.defs: * tests/test_gio.py: Wrap gio.FileEnumerator.next_files_async/next_files_done. Update the example to use them instead of the synchronous versions, add documentation and tests. svn path=/trunk/; revision=832
Diffstat (limited to 'tests')
-rw-r--r--tests/test_gio.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/test_gio.py b/tests/test_gio.py
index df82e36..00ccb5a 100644
--- a/tests/test_gio.py
+++ b/tests/test_gio.py
@@ -119,6 +119,23 @@ class TestGFileEnumerator(unittest.TestCase):
loop = gobject.MainLoop()
loop.run()
+ def testNextFilesAsync(self):
+ def callback(enumerator, result):
+ try:
+ for file_info in enumerator.next_files_finish(result):
+ if file_info.get_name() == 'test_gio.py':
+ break
+ else:
+ raise AssertionError
+ finally:
+ loop.quit()
+
+ enumerator = self.file.enumerate_children(
+ "standard::*", gio.FILE_QUERY_INFO_NOFOLLOW_SYMLINKS)
+ enumerator.next_files_async(1000, callback)
+ loop = gobject.MainLoop()
+ loop.run()
+
class TestInputStream(unittest.TestCase):
def setUp(self):