diff options
author | Gian Mario Tagliaretti <gianmt@gnome.org> | 2009-05-24 22:12:04 +0200 |
---|---|---|
committer | Gian Mario Tagliaretti <gianmt@gnome.org> | 2009-05-24 22:19:34 +0200 |
commit | 11524cdf6472d9115a812ce431f6767aec5627bc (patch) | |
tree | 55c5a0621009141fad38c72e61a0d320e79bf8ea /tests | |
parent | 82ad6b8c8ea4d6694126f5e0e67b826717e38f19 (diff) | |
download | pygobject-11524cdf6472d9115a812ce431f6767aec5627bc.tar.gz pygobject-11524cdf6472d9115a812ce431f6767aec5627bc.tar.xz pygobject-11524cdf6472d9115a812ce431f6767aec5627bc.zip |
Wrap gio.OutputStream.splice_async()
wrap gio.OutputStream.splice_async() and add a test.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_gio.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/test_gio.py b/tests/test_gio.py index cf82658..05b82b3 100644 --- a/tests/test_gio.py +++ b/tests/test_gio.py @@ -816,6 +816,26 @@ class TestOutputStream(unittest.TestCase): loop = glib.MainLoop() loop.run() + + def testSpliceAsync(self): + _f = open("stream.txt", "w+") + _f.write("testing") + _f.seek(0) + instream = gio.unix.InputStream(_f.fileno(), False) + + def callback(stream, result): + try: + size = stream.splice_finish(result) + self.assertEqual(size, 7) + + finally: + os.unlink("stream.txt") + loop.quit() + + self.stream.splice_async(instream, callback) + + loop = glib.MainLoop() + loop.run() class TestMemoryOutputStream(unittest.TestCase): def setUp(self): |