summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGian Mario Tagliaretti <gianmt@gnome.org>2010-01-01 11:14:35 +0100
committerGian Mario Tagliaretti <gianmt@gnome.org>2010-01-01 11:14:35 +0100
commitc9496b29ef9ef232020a4044577d2947353953a5 (patch)
tree39bf7585787c614ea2c6345bce505e3c9984ce49 /tests
parent1aa5e301c49f11e1c5ef58de44b4b03f714d1a70 (diff)
downloadpygobject-c9496b29ef9ef232020a4044577d2947353953a5.tar.gz
pygobject-c9496b29ef9ef232020a4044577d2947353953a5.tar.xz
pygobject-c9496b29ef9ef232020a4044577d2947353953a5.zip
Wrap gio.SocketListener.accept_socket() and add a test
Diffstat (limited to 'tests')
-rw-r--r--tests/test_gsocket.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/test_gsocket.py b/tests/test_gsocket.py
index 7789332..fd19cbb 100644
--- a/tests/test_gsocket.py
+++ b/tests/test_gsocket.py
@@ -61,3 +61,16 @@ class TestSocketListener(unittest.TestCase):
connection, source = listener.accept(cancellable=None)
self.failUnless(isinstance(connection, gio.TcpConnection))
+
+ def test_socket_listener_accept_socket(self):
+ address = gio.inet_address_new_from_string("127.0.0.1")
+ inetsock = gio.InetSocketAddress(address, 1024)
+
+ listener = gio.SocketListener()
+ listener.add_address(inetsock, gio.SOCKET_TYPE_STREAM, gio.SOCKET_PROTOCOL_TCP)
+
+ client = gio.SocketClient()
+ client.connect_to_host("127.0.0.1:1024", 1024)
+
+ socket, source = listener.accept_socket(cancellable=None)
+ self.failUnless(isinstance(socket, gio.Socket))