diff options
Diffstat (limited to 'tests/test_gio.py')
-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 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()), |