summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGian Mario Tagliaretti <gianmt@gnome.org>2009-05-04 23:40:28 +0200
committerGian Mario Tagliaretti <gianmt@gnome.org>2009-05-05 00:01:26 +0200
commitd58322b84d47da7905f95b43e9e0daf9f7c4b507 (patch)
tree7813dc892994566c4acc2857b631e904fdcde6eb /tests
parent2311187824d1b48a996ee2620fd3c9a63e3edd66 (diff)
downloadpygobject-d58322b84d47da7905f95b43e9e0daf9f7c4b507.tar.gz
pygobject-d58322b84d47da7905f95b43e9e0daf9f7c4b507.tar.xz
pygobject-d58322b84d47da7905f95b43e9e0daf9f7c4b507.zip
Wrap gio.InputStream.skip_async()
wrap gio.InputStream.skip_async() and add a test.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_gio.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/test_gio.py b/tests/test_gio.py
index 7534ac0..d36c213 100644
--- a/tests/test_gio.py
+++ b/tests/test_gio.py
@@ -580,6 +580,26 @@ class TestInputStream(unittest.TestCase):
50),
some_data)
+ def testSkip(self):
+ self.stream.skip(2)
+ res = self.stream.read()
+ self.assertEqual(res, "sting")
+
+ def testSkipAsync(self):
+ def callback(stream, result):
+ try:
+ size = stream.skip_finish(result)
+ self.assertEqual(size, 2)
+ res = stream.read()
+ self.assertEqual(res, "sting")
+ finally:
+ loop.quit()
+
+ self.stream.skip_async(2, callback)
+
+ loop = glib.MainLoop()
+ loop.run()
+
def test_read_part(self):
self.assertEquals(self._read_in_loop(self.stream,
lambda: self.stream.read_part()),