From dff024256295c15e49888ad9d5fef74a7746edd7 Mon Sep 17 00:00:00 2001 From: Gian Mario Tagliaretti Date: Wed, 30 Dec 2009 23:44:25 +0100 Subject: Wrap gio.SocketAddressEnumerator.next_async() and add a test --- tests/test_gsocket.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'tests') diff --git a/tests/test_gsocket.py b/tests/test_gsocket.py index 671026f..9ac2398 100644 --- a/tests/test_gsocket.py +++ b/tests/test_gsocket.py @@ -23,3 +23,19 @@ class TestSocket(unittest.TestCase): def tearDown(self): self.sock.close() + +class TestSocketAddress(unittest.TestCase): + def test_socket_address_enumerator_next_async(self): + def callback(enumerator, result): + try: + address = enumerator.next_finish(result) + self.failUnless(isinstance(address, gio.SocketAddress)) + finally: + loop.quit() + + socket = gio.NetworkAddress("www.pygtk.org", 80) + enumerator = socket.enumerate() + enumerator.next_async(callback) + + loop = glib.MainLoop() + loop.run() -- cgit