diff options
author | Gian Mario Tagliaretti <gianmt@gnome.org> | 2009-12-30 16:21:49 +0100 |
---|---|---|
committer | Gian Mario Tagliaretti <gianmt@gnome.org> | 2009-12-30 16:21:49 +0100 |
commit | 50960656815b0897a5ebe5f011537b8dcbdc857e (patch) | |
tree | 0819db5512b5f93e3766f3e4d196d84f5817c845 /tests | |
parent | de7a359e81792ae8573ac944455ea289985449ed (diff) | |
download | pygobject-50960656815b0897a5ebe5f011537b8dcbdc857e.tar.gz pygobject-50960656815b0897a5ebe5f011537b8dcbdc857e.tar.xz pygobject-50960656815b0897a5ebe5f011537b8dcbdc857e.zip |
Wrap gio.Socket.condition_check() and add a test
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_gsocket.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/test_gsocket.py b/tests/test_gsocket.py new file mode 100644 index 0000000..8f138a4 --- /dev/null +++ b/tests/test_gsocket.py @@ -0,0 +1,21 @@ +# -*- Mode: Python -*- + +import os +import unittest + +from common import gio, glib, gobject + + +class TestSocket(unittest.TestCase): + def setUp(self): + self.sock = gio.Socket(gio.SOCKET_FAMILY_IPV4, + gio.SOCKET_TYPE_STREAM, + gio.SOCKET_PROTOCOL_TCP) + + def test_socket_condition(self): + check = self.sock.condition_check(glib.IO_OUT) + self.failUnless(isinstance(check, gobject.GFlags)) + self.failUnlessEqual(check, glib.IO_OUT | glib.IO_HUP) + + def tearDown(self): + self.sock.close() |