summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGian Mario Tagliaretti <gianmt@gnome.org>2009-12-30 23:44:25 +0100
committerGian Mario Tagliaretti <gianmt@gnome.org>2009-12-30 23:44:25 +0100
commitdff024256295c15e49888ad9d5fef74a7746edd7 (patch)
treea4ebb5cdb0a3e60915abef46d3ee99ef7844e67e /tests
parente2330bd0d6cbc49b0ecb27b30e3b0593935ce229 (diff)
downloadpygobject-dff024256295c15e49888ad9d5fef74a7746edd7.tar.gz
pygobject-dff024256295c15e49888ad9d5fef74a7746edd7.tar.xz
pygobject-dff024256295c15e49888ad9d5fef74a7746edd7.zip
Wrap gio.SocketAddressEnumerator.next_async() and add a test
Diffstat (limited to 'tests')
-rw-r--r--tests/test_gsocket.py16
1 files changed, 16 insertions, 0 deletions
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()