summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGian Mario Tagliaretti <gianmt@gnome.org>2009-06-02 10:41:26 +0200
committerGian Mario Tagliaretti <gianmt@gnome.org>2009-06-02 10:41:26 +0200
commit180c157f2a20b7d2dd9af05bfb5f515fd23870a0 (patch)
treea0889e4980139409f436aaf80cb1b98d65be1c4c /tests
parent4673577d1f6c3d54423808dd575987092fb05ad2 (diff)
downloadpygobject-180c157f2a20b7d2dd9af05bfb5f515fd23870a0.tar.gz
pygobject-180c157f2a20b7d2dd9af05bfb5f515fd23870a0.tar.xz
pygobject-180c157f2a20b7d2dd9af05bfb5f515fd23870a0.zip
Wrap gio.FileOutputStream.query_info_async
Add the wrapper for gio.FileOutputStream.query_info_async including docs and a test.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_gio.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/test_gio.py b/tests/test_gio.py
index 203f933..fb7360e 100644
--- a/tests/test_gio.py
+++ b/tests/test_gio.py
@@ -1011,3 +1011,30 @@ class TestFileInputStream(unittest.TestCase):
loop = glib.MainLoop()
loop.run()
+
+class TestFileOutputStream(unittest.TestCase):
+ def setUp(self):
+ self._f = open("file.txt", "w+")
+ self._f.write("testing")
+ self._f.seek(0)
+ self.file = gio.File("file.txt")
+
+ def tearDown(self):
+ self._f.close()
+ if os.path.exists('file.txt'):
+ os.unlink("file.txt")
+
+ 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()
+
+ outputstream = self.file.append_to()
+ outputstream.query_info_async("standard", callback)
+
+ loop = glib.MainLoop()
+ loop.run()