summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGian Mario Tagliaretti <gianmt@gnome.org>2009-12-28 22:41:54 +0100
committerGian Mario Tagliaretti <gianmt@gnome.org>2009-12-28 22:41:54 +0100
commitb90c01cff5ff5cb2796182f2ffd7b5248eaeed6a (patch)
tree00dbed6dce93cefa5bfd9875aae223c8837f7573 /tests
parent0bff01bcee73a0e0d18342331136119c4e8bf151 (diff)
downloadpygobject-b90c01cff5ff5cb2796182f2ffd7b5248eaeed6a.tar.gz
pygobject-b90c01cff5ff5cb2796182f2ffd7b5248eaeed6a.tar.xz
pygobject-b90c01cff5ff5cb2796182f2ffd7b5248eaeed6a.zip
Wrap GIOStream.close_async() and add a test
Diffstat (limited to 'tests')
-rw-r--r--tests/test_gio.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/test_gio.py b/tests/test_gio.py
index fd2edba..49d83e8 100644
--- a/tests/test_gio.py
+++ b/tests/test_gio.py
@@ -1072,3 +1072,24 @@ class TestBufferedInputStream(unittest.TestCase):
loop = glib.MainLoop()
loop.run()
+
+class TestIOStream(unittest.TestCase):
+ def setUp(self):
+ self.file = gio.File("file.txt")
+ self.iofile = self.file.create_readwrite(gio.FILE_CREATE_NONE)
+
+ def tearDown(self):
+ if os.path.exists('file.txt'):
+ os.unlink("file.txt")
+
+ def testIOStreamCloseAsync(self):
+ def callback(stream, result):
+ try:
+ self.failUnless(stream.close_finish(result))
+ finally:
+ loop.quit()
+
+ self.iofile.close_async(callback)
+
+ loop = glib.MainLoop()
+ loop.run()