summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
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))