diff options
author | Gian Mario Tagliaretti <gianmt@gnome.org> | 2009-12-31 16:35:18 +0100 |
---|---|---|
committer | Gian Mario Tagliaretti <gianmt@gnome.org> | 2009-12-31 16:35:18 +0100 |
commit | 1aa5e301c49f11e1c5ef58de44b4b03f714d1a70 (patch) | |
tree | 31fa8a794faaea76bfabdccf850bbec7de5e8744 /tests | |
parent | aaedcf166c78baf5449ef59d0ade4a29077fedc7 (diff) | |
download | pygobject-1aa5e301c49f11e1c5ef58de44b4b03f714d1a70.tar.gz pygobject-1aa5e301c49f11e1c5ef58de44b4b03f714d1a70.tar.xz pygobject-1aa5e301c49f11e1c5ef58de44b4b03f714d1a70.zip |
Wrap gio.SocketListener.accept() and add a test
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_gsocket.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/test_gsocket.py b/tests/test_gsocket.py index b5b3694..7789332 100644 --- a/tests/test_gsocket.py +++ b/tests/test_gsocket.py @@ -48,3 +48,16 @@ class TestSocketListener(unittest.TestCase): listener = gio.SocketListener() effective = listener.add_address(inetsock, gio.SOCKET_TYPE_STREAM, gio.SOCKET_PROTOCOL_TCP) self.failUnless(isinstance(effective, gio.InetSocketAddress)) + + def test_socket_listener_accept(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) + + connection, source = listener.accept(cancellable=None) + self.failUnless(isinstance(connection, gio.TcpConnection)) |