diff options
author | Jonny Lamb <jonny.lamb@collabora.co.uk> | 2011-10-28 18:11:07 +0100 |
---|---|---|
committer | Jonny Lamb <jonny.lamb@collabora.co.uk> | 2011-10-28 18:46:33 +0100 |
commit | aa920049bbafadb7af1dc3cc652bfc5ce9b29b50 (patch) | |
tree | 0eb3c701c5bc743e9375bf3b539c0ca4a5c30462 /tests | |
parent | b1a002fbbcbd758261290e665940f82ea07ee57e (diff) | |
download | telepathy-salut-aa920049bbafadb7af1dc3cc652bfc5ce9b29b50.tar.gz |
caps-helper: update disco helper method to work with Salut
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/twisted/caps_helper.py | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/tests/twisted/caps_helper.py b/tests/twisted/caps_helper.py index 0d4f3598..4921e0f6 100644 --- a/tests/twisted/caps_helper.py +++ b/tests/twisted/caps_helper.py @@ -249,18 +249,15 @@ def extract_data_forms(x_nodes): return dataforms -def disco_caps(q, stream, presence): - c_nodes = xpath.queryForNodes('/presence/c', presence.stanza) - assert c_nodes is not None - assertLength(1, c_nodes) - hash = c_nodes[0].attributes['hash'] - ver = c_nodes[0].attributes['ver'] - node = c_nodes[0].attributes['node'] +def disco_caps(q, stream, txt): + hash = txt_get_key(txt, 'hash') + ver = txt_get_key(txt, 'ver') + node = txt_get_key(txt, 'node') assertEquals('sha-1', hash) # ask caps request = \ - elem_iq(stream, 'get', from_='fake_contact@jabber.org/resource')( + elem_iq(stream, 'get', from_='fake_contact@nearby')( elem(ns.DISCO_INFO, 'query', node=(node + '#' + ver)) ) stream.send(request) @@ -274,11 +271,11 @@ def disco_caps(q, stream, presence): identity_node = identity_nodes[0] assertEquals('client', identity_node['category']) - assertEquals(config.CLIENT_TYPE, identity_node['type']) + assertEquals('pc', identity_node['type']) assertEquals(config.PACKAGE_STRING, identity_node['name']) assertDoesNotContain('xml:lang', identity_node.attributes) - identity = 'client/%s//%s' % (config.CLIENT_TYPE, config.PACKAGE_STRING) + identity = 'client/%s//%s' % ('pc', config.PACKAGE_STRING) features = [] for feature in xpath.queryForNodes('/iq/query/feature', event.stanza): |