[telepathy-gabble/master] check_new_connection_access: check cs.SOCKET_ACCESS_CONTROL_CREDENTIALS

Guillaume Desmottes guillaume.desmottes at collabora.co.uk
Thu May 7 07:58:05 PDT 2009


---
 tests/twisted/tubes/tubetestutil.py |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/tests/twisted/tubes/tubetestutil.py b/tests/twisted/tubes/tubetestutil.py
index 73adb23..7781c5c 100644
--- a/tests/twisted/tubes/tubetestutil.py
+++ b/tests/twisted/tubes/tubetestutil.py
@@ -275,6 +275,17 @@ def check_new_connection_access(q, access_control, access_control_param, protoco
         address = protocol.transport.getPeer()
         assertEquals(ip, address.host)
         assertEquals(port, address.port)
+    elif access_control == cs.SOCKET_ACCESS_CONTROL_CREDENTIALS:
+        byte = access_control_param
+
+        e = q.expect('socket-data', protocol=protocol)
+        assert ord(e.data) == byte
+
+        # FIXME: check if credentials are actually passed. This is actually
+        # really hard to test because Python doesn't implement recvmsg().
+        # Twisted's transport abstraction doesn't help either.
+        # Credentials passing in tested in Gibber's tests so not testing it
+        # here is actually not that bad.
     else:
         assert False
 
-- 
1.5.6.5




More information about the telepathy-commits mailing list