[Telepathy-commits] [telepathy-gabble/master] update test-capabilities to test that adding a new capability later (adding video in this case) causes another CapabilitiesChanged signal

Robert McQueen robert.mcqueen at collabora.co.uk
Tue Aug 19 10:52:14 PDT 2008


20080508114120-418b8-014da69857d9ed9d5685c7055fb5ccccd3aad28c.gz
---
 tests/twisted/test-capabilities.py |   23 ++++++++++++++++++++++-
 1 files changed, 22 insertions(+), 1 deletions(-)

diff --git a/tests/twisted/test-capabilities.py b/tests/twisted/test-capabilities.py
index e9aef79..98ad913 100644
--- a/tests/twisted/test-capabilities.py
+++ b/tests/twisted/test-capabilities.py
@@ -64,13 +64,34 @@ def test(q, bus, conn, stream):
     event = q.expect('dbus-signal', signal='CapabilitiesChanged',
         args=[[(2, sm, 0, 3, 0, 1)]])
 
+    # send updated presence with video support
+    presence = make_presence('bob at foo.com/Foo', None, 'hello')
+    c = presence.addElement(('http://jabber.org/protocol/caps', 'c'))
+    c['node'] = 'http://telepathy.freedesktop.org/fake-client'
+    c['ver'] = '0.1'
+    c['ext'] = 'video'
+    stream.send(presence)
+
+    # Gabble looks up our new capabilities
+    event = q.expect('stream-iq', to='bob at foo.com/Foo',
+        query_ns='http://jabber.org/protocol/disco#info')
+    result = make_result_iq(stream, event.stanza)
+    query = result.firstChildElement()
+    feature = query.addElement('feature')
+    feature['var'] = 'http://jabber.org/protocol/jingle/description/video'
+    stream.send(result)
+
+    # we can now do video calls too
+    event = q.expect('dbus-signal', signal='CapabilitiesChanged',
+        args=[[(2, sm, 3, 3, 1, 3)]])
+
     # go offline
     presence = make_presence('bob at foo.com/Foo', 'unavailable', None)
     stream.send(presence)
 
     # can't do calls any more
     event = q.expect('dbus-signal', signal='CapabilitiesChanged',
-        args=[[(2, sm, 3, 0, 1, 0)]])
+        args=[[(2, sm, 3, 0, 3, 0)]])
 
     # regression test for fd.o #15198: getting caps of invalid handle crashed
     try:
-- 
1.5.6.3




More information about the Telepathy-commits mailing list