[telepathy-gabble/master] add PUBSUB_EVENT to ns.py
Guillaume Desmottes
guillaume.desmottes at collabora.co.uk
Thu Sep 3 02:55:41 PDT 2009
---
tests/twisted/ns.py | 1 +
tests/twisted/olpc/util.py | 2 +-
tests/twisted/pubsub.py | 14 +++++++-------
tests/twisted/test-location.py | 2 +-
tests/twisted/vcard/test-alias-pep.py | 2 +-
5 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/tests/twisted/ns.py b/tests/twisted/ns.py
index 6b483d7..2e9346b 100644
--- a/tests/twisted/ns.py
+++ b/tests/twisted/ns.py
@@ -44,6 +44,7 @@ OLPC_BUDDY_PROPS_NOTIFY = "%s+notify" % OLPC_BUDDY_PROPS
OLPC_CURRENT_ACTIVITY = "http://laptop.org/xmpp/current-activity"
OLPC_CURRENT_ACTIVITY_NOTIFY = "%s+notify" % OLPC_CURRENT_ACTIVITY
PUBSUB = "http://jabber.org/protocol/pubsub"
+PUBSUB_EVENT = "%s#event" % PUBSUB
REGISTER = "jabber:iq:register"
ROSTER = "jabber:iq:roster"
SEARCH = 'jabber:iq:search'
diff --git a/tests/twisted/olpc/util.py b/tests/twisted/olpc/util.py
index 9f178ee..9091a43 100644
--- a/tests/twisted/olpc/util.py
+++ b/tests/twisted/olpc/util.py
@@ -72,7 +72,7 @@ def _make_pubsub_event_msg(from_, node):
item = domish.Element((None, 'item'))
message = elem('message', from_=from_, to='test at localhost')(
- elem("%s#event" % ns.PUBSUB, 'event')(
+ elem(ns.PUBSUB_EVENT, 'event')(
elem('items', node=node)(item)))
return message, item
diff --git a/tests/twisted/pubsub.py b/tests/twisted/pubsub.py
index 77a1788..70de708 100644
--- a/tests/twisted/pubsub.py
+++ b/tests/twisted/pubsub.py
@@ -30,7 +30,7 @@ def test(q, bus, conn, stream):
# event node without 'from'
message = elem('message')(
- elem((ns.PUBSUB + "#event"), 'event')(
+ elem((ns.PUBSUB_EVENT), 'event')(
elem('items', node=ns.GEOLOC)(
elem('item', id='12345')(
elem(ns.GEOLOC, 'geoloc')(
@@ -39,7 +39,7 @@ def test(q, bus, conn, stream):
# event node with an invalid 'from'
message = elem('message', from_='aaaa')(
- elem((ns.PUBSUB + "#event"), 'event')(
+ elem((ns.PUBSUB_EVENT), 'event')(
elem('items', node=ns.GEOLOC)(
elem('item', id='12345')(
elem(ns.GEOLOC, 'geoloc')(
@@ -48,25 +48,25 @@ def test(q, bus, conn, stream):
# no items node
message = elem('message', from_='bob at foo.com')(
- elem((ns.PUBSUB + "#event"), 'event')())
+ elem((ns.PUBSUB_EVENT), 'event')())
stream.send(message)
# no item node
message = elem('message', from_='bob at foo.com')(
- elem((ns.PUBSUB + "#event"), 'event')(
+ elem((ns.PUBSUB_EVENT), 'event')(
elem('items', node=ns.GEOLOC)()))
stream.send(message)
# item node doesn't have any child
message = elem('message', from_='bob at foo.com')(
- elem((ns.PUBSUB + "#event"), 'event')(
+ elem((ns.PUBSUB_EVENT), 'event')(
elem('items', node=ns.GEOLOC)(
elem('item', id='12345')())))
stream.send(message)
# the child of the item node doesn't have a NS
message = elem('message', from_='bob at foo.com')(
- elem((ns.PUBSUB + "#event"), 'event')(
+ elem((ns.PUBSUB_EVENT), 'event')(
elem('items', node=ns.GEOLOC)(
elem('item', id='12345')(
elem('geoloc')(
@@ -75,7 +75,7 @@ def test(q, bus, conn, stream):
# valid but unknown pubsub notification
message = elem('message', from_='bob at foo.com')(
- elem((ns.PUBSUB + "#event"), 'event')(
+ elem((ns.PUBSUB_EVENT), 'event')(
elem('items', node='http://www.badger.com')(
elem('item', id='12345')(
elem('http://www.badger.com', 'badger')(
diff --git a/tests/twisted/test-location.py b/tests/twisted/test-location.py
index fceb5bd..dc35df2 100644
--- a/tests/twisted/test-location.py
+++ b/tests/twisted/test-location.py
@@ -190,7 +190,7 @@ def test(q, bus, conn, stream):
# Bob updates his location
message = elem('message', from_='bob at foo.com')(
- elem((ns.PUBSUB + "#event"), 'event')(
+ elem((ns.PUBSUB_EVENT), 'event')(
elem('items', node=ns.GEOLOC)(
elem('item', id='12345')(
elem(ns.GEOLOC, 'geoloc')(
diff --git a/tests/twisted/vcard/test-alias-pep.py b/tests/twisted/vcard/test-alias-pep.py
index 68c32f4..4a485a5 100644
--- a/tests/twisted/vcard/test-alias-pep.py
+++ b/tests/twisted/vcard/test-alias-pep.py
@@ -48,7 +48,7 @@ def test(q, bus, conn, stream):
# <https://bugs.freedesktop.org/show_bug.cgi?id=21817>, where this would
# crash Gabble.
message = elem('message', from_='bob at foo.com')(
- elem((ns.PUBSUB + "#event"), 'event')(
+ elem((ns.PUBSUB_EVENT), 'event')(
elem('items', node=ns.NICK)(
elem('item')(
elem(ns.NICK, 'nick')
--
1.5.6.5
More information about the telepathy-commits
mailing list