From 0fe00109c4f6fc27cbaae9b0a24ecfac71355d2f Mon Sep 17 00:00:00 2001 From: Gian Mario Tagliaretti Date: Tue, 29 Dec 2009 09:54:05 +0100 Subject: Wrap gio.FileIOStream.query_info_async() and add a test --- tests/test_gio.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'tests/test_gio.py') diff --git a/tests/test_gio.py b/tests/test_gio.py index 49d83e8..a9ef159 100644 --- a/tests/test_gio.py +++ b/tests/test_gio.py @@ -1093,3 +1093,21 @@ class TestIOStream(unittest.TestCase): loop = glib.MainLoop() loop.run() + + + def testQueryInfoAsync(self): + def callback(stream, result): + try: + info = stream.query_info_finish(result) + self.failUnless(isinstance(info, gio.FileInfo)) + self.failUnless(info.get_attribute_uint64("standard::size"), 7) + finally: + loop.quit() + + ostream = self.iofile.get_output_stream() + ostream.write("testing") + + self.iofile.query_info_async("standard", callback) + + loop = glib.MainLoop() + loop.run() -- cgit