diff options
author | Gian Mario Tagliaretti <gianmt@gnome.org> | 2009-12-28 22:41:54 +0100 |
---|---|---|
committer | Gian Mario Tagliaretti <gianmt@gnome.org> | 2009-12-28 22:41:54 +0100 |
commit | b90c01cff5ff5cb2796182f2ffd7b5248eaeed6a (patch) | |
tree | 00dbed6dce93cefa5bfd9875aae223c8837f7573 /tests | |
parent | 0bff01bcee73a0e0d18342331136119c4e8bf151 (diff) | |
download | pygobject-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.py | 21 |
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() |