summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test_gsocket.py21
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()