[telepathy-gabble/master] tests: use constants for StatusChanged arguments throughout
Simon McVittie
simon.mcvittie at collabora.co.uk
Wed Jul 29 04:54:51 PDT 2009
Also remove some commented-out expectations of StatusChanged, and in
tubes/accept-muc-dbus-tube.py, import constants as cs rather than c
to be consistent with other tests.
Reviewed-by: Guillaume Desmottes <guillaume.desmottes at collabora.co.uk>
---
tests/twisted/avatar-requirements.py | 3 +-
tests/twisted/caps/advertise-draft1.py | 3 +-
tests/twisted/caps/advertise-legacy.py | 3 +-
tests/twisted/caps/caps-cache.py | 3 +-
tests/twisted/caps/hashed-caps.py | 3 +-
tests/twisted/caps/initial-caps.py | 3 +-
tests/twisted/caps/receive-jingle.py | 3 +-
tests/twisted/caps/tube-caps.py | 3 +-
tests/twisted/connect/test-nonblocking-tls.py | 10 +++-
tests/twisted/connect/test-twice.py | 13 ++++--
.../twisted/file-transfer/file_transfer_helper.py | 3 +-
.../file-transfer/test-caps-file-transfer.py | 3 +-
tests/twisted/jingle/google-relay.py | 6 ++-
tests/twisted/jingle/jingletest2.py | 7 ++-
tests/twisted/jingle/outgoing-many-streams.py | 6 ++-
tests/twisted/jingle/payload-types.py | 6 ++-
tests/twisted/jingle/stream-handler-error.py | 3 +-
tests/twisted/jingle/stun-server.py | 6 ++-
.../jingle/test-wait-for-caps-incomplete.py | 6 ++-
tests/twisted/jingle/test-wait-for-caps.py | 6 ++-
tests/twisted/muc/name-conflict.py | 4 +-
tests/twisted/muc/renamed.py | 4 +-
tests/twisted/muc/roomlist.py | 4 +-
tests/twisted/muc/send-error.py | 3 +-
tests/twisted/muc/test-ensure.py | 3 +-
tests/twisted/muc/test-muc-invitation.py | 3 +-
tests/twisted/muc/test-muc-ownership.py | 3 +-
tests/twisted/muc/test-muc-properties.py | 3 +-
tests/twisted/muc/test-muc.py | 3 +-
tests/twisted/olpc/change-notifications.py | 5 +-
tests/twisted/olpc/current-activity.py | 5 +-
tests/twisted/olpc/gadget-invite.py | 3 +-
tests/twisted/olpc/gadget-publish.py | 5 +-
tests/twisted/olpc/gadget-restarted.py | 3 +-
tests/twisted/olpc/olpc-activity-search.py | 3 +-
tests/twisted/olpc/olpc-buddy-search.py | 3 +-
tests/twisted/olpc/olpc-muc-invitation.py | 3 +-
tests/twisted/olpc/olpc-muc-prop-change.py | 3 +-
tests/twisted/olpc/test-olpc-bundle.py | 4 +-
tests/twisted/olpc/test-olpc-set-props-preload.py | 1 -
tests/twisted/olpc/view-presence.py | 3 +-
tests/twisted/presence/presence.py | 4 +-
tests/twisted/roster/ensure.py | 1 -
tests/twisted/roster/groups-12791.py | 1 -
tests/twisted/roster/groups.py | 1 -
tests/twisted/roster/request-group-after-roster.py | 1 -
.../twisted/roster/request-group-before-roster.py | 1 -
tests/twisted/roster/test-roster.py | 1 -
tests/twisted/roster/test-save-alias-to-roster.py | 3 +-
tests/twisted/test-debug.py | 3 +-
tests/twisted/test-disco-no-reply.py | 7 ++-
tests/twisted/test-disco.py | 4 +-
tests/twisted/test-fallback-socks5-proxy.py | 3 +-
tests/twisted/test-location.py | 4 +-
tests/twisted/test-set-status-idempotence.py | 6 ++-
tests/twisted/text/destroy.py | 3 +-
tests/twisted/text/ensure.py | 3 +-
tests/twisted/text/initiate-requestotron.py | 3 +-
tests/twisted/text/initiate.py | 3 +-
tests/twisted/text/respawn.py | 3 +-
tests/twisted/text/send-error.py | 3 +-
tests/twisted/text/send-to-correct-resource.py | 3 +-
tests/twisted/text/test-chat-state.py | 3 +-
tests/twisted/text/test-text-delayed.py | 3 +-
tests/twisted/text/test-text-no-body.py | 3 +-
tests/twisted/text/test-text.py | 3 +-
tests/twisted/tubes/accept-muc-dbus-tube.py | 43 ++++++++++----------
tests/twisted/tubes/accept-muc-stream-tube.py | 3 +-
tests/twisted/tubes/accept-private-dbus-tube.py | 3 +-
tests/twisted/tubes/accept-private-stream-tube.py | 3 +-
tests/twisted/tubes/close-muc-with-closed-tube.py | 3 +-
tests/twisted/tubes/crash-on-list-channels.py | 3 +-
.../twisted/tubes/create-invalid-tube-channels.py | 3 +-
tests/twisted/tubes/ensure-si-tube.py | 3 +-
tests/twisted/tubes/muc-presence.py | 4 +-
tests/twisted/tubes/offer-muc-dbus-tube.py | 3 +-
tests/twisted/tubes/offer-muc-stream-tube.py | 3 +-
tests/twisted/tubes/offer-no-caps.py | 3 +-
tests/twisted/tubes/offer-private-dbus-tube.py | 3 +-
tests/twisted/tubes/offer-private-stream-tube.py | 3 +-
tests/twisted/tubes/request-invalid-dbus-tube.py | 3 +-
tests/twisted/tubes/test-socks5-muc.py | 3 +-
tests/twisted/vcard/test-alias-empty-vcard.py | 4 +-
tests/twisted/vcard/test-alias.py | 4 +-
tests/twisted/vcard/test-avatar-async.py | 4 +-
tests/twisted/vcard/test-avatar-retrieved.py | 4 +-
tests/twisted/vcard/test-avatar-tokens.py | 4 +-
tests/twisted/vcard/test-avatar.py | 4 +-
tests/twisted/vcard/test-set-alias.py | 4 +-
tests/twisted/vcard/test-vcard-cache.py | 3 +-
90 files changed, 236 insertions(+), 127 deletions(-)
diff --git a/tests/twisted/avatar-requirements.py b/tests/twisted/avatar-requirements.py
index 1c6ded6..77e93e2 100644
--- a/tests/twisted/avatar-requirements.py
+++ b/tests/twisted/avatar-requirements.py
@@ -4,7 +4,8 @@ import constants as cs
def test(q, bus, conn, stream):
conn.Connect()
- q.expect('dbus-signal', signal='StatusChanged', args=[0, 1])
+ q.expect('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED])
props = conn.GetAll(cs.CONN_IFACE_AVATARS,
dbus_interface=cs.PROPERTIES_IFACE)
diff --git a/tests/twisted/caps/advertise-draft1.py b/tests/twisted/caps/advertise-draft1.py
index 656e210..817bc60 100644
--- a/tests/twisted/caps/advertise-draft1.py
+++ b/tests/twisted/caps/advertise-draft1.py
@@ -26,7 +26,8 @@ def run_test(q, bus, conn, stream):
conn.Connect()
_, initial_presence = q.expect_many(
- EventPattern('dbus-signal', signal='StatusChanged', args=[0, 1]),
+ EventPattern('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED]),
EventPattern('stream-presence'),
)
diff --git a/tests/twisted/caps/advertise-legacy.py b/tests/twisted/caps/advertise-legacy.py
index 5b577f8..b46c0d2 100644
--- a/tests/twisted/caps/advertise-legacy.py
+++ b/tests/twisted/caps/advertise-legacy.py
@@ -17,7 +17,8 @@ def run_test(q, bus, conn, stream):
conn.Connect()
_, initial_presence = q.expect_many(
- EventPattern('dbus-signal', signal='StatusChanged', args=[0, 1]),
+ EventPattern('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED]),
EventPattern('stream-presence'),
)
diff --git a/tests/twisted/caps/caps-cache.py b/tests/twisted/caps/caps-cache.py
index ca469bc..b78d6ab 100644
--- a/tests/twisted/caps/caps-cache.py
+++ b/tests/twisted/caps/caps-cache.py
@@ -113,7 +113,8 @@ def _test_with_hash(q, bus, conn, stream, contact, client, disco):
def test(q, bus, conn, stream):
conn.Connect()
- q.expect('dbus-signal', signal='StatusChanged', args=[0, 1])
+ q.expect('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED])
client = 'http://telepathy.freedesktop.org/fake-client'
diff --git a/tests/twisted/caps/hashed-caps.py b/tests/twisted/caps/hashed-caps.py
index 9c2bfee..15267a2 100644
--- a/tests/twisted/caps/hashed-caps.py
+++ b/tests/twisted/caps/hashed-caps.py
@@ -281,7 +281,8 @@ def test_two_clients(q, bus, conn, stream, contact1, contact2,
def test(q, bus, conn, stream):
conn.Connect()
- q.expect('dbus-signal', signal='StatusChanged', args=[0, 1])
+ q.expect('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED])
# be notified when the signal CapabilitiesChanged is fired
conn_caps_iface = dbus.Interface(conn, cs.CONN_IFACE_CAPS)
diff --git a/tests/twisted/caps/initial-caps.py b/tests/twisted/caps/initial-caps.py
index 83939b0..8357559 100644
--- a/tests/twisted/caps/initial-caps.py
+++ b/tests/twisted/caps/initial-caps.py
@@ -16,7 +16,8 @@ def run_test(q, bus, conn, stream):
conn.Connect()
_, initial_presence = q.expect_many(
- EventPattern('dbus-signal', signal='StatusChanged', args=[0, 1]),
+ EventPattern('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED]),
EventPattern('stream-presence'),
)
diff --git a/tests/twisted/caps/receive-jingle.py b/tests/twisted/caps/receive-jingle.py
index f83b54c..c1e2fe0 100644
--- a/tests/twisted/caps/receive-jingle.py
+++ b/tests/twisted/caps/receive-jingle.py
@@ -13,7 +13,8 @@ basic_caps = [(2, cs.CHANNEL_TYPE_TEXT, 3, 0)]
def test(q, bus, conn, stream):
conn.Connect()
- q.expect('dbus-signal', signal='StatusChanged', args=[0, 1])
+ q.expect('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED])
presence = make_presence('bob at foo.com/Foo', status='hello')
stream.send(presence)
diff --git a/tests/twisted/caps/tube-caps.py b/tests/twisted/caps/tube-caps.py
index 33a4a6d..fcc0a89 100644
--- a/tests/twisted/caps/tube-caps.py
+++ b/tests/twisted/caps/tube-caps.py
@@ -343,7 +343,8 @@ def test_tube_caps_to_contact(q, bus, conn, stream):
def test(q, bus, conn, stream):
conn.Connect()
- q.expect('dbus-signal', signal='StatusChanged', args=[0, 1])
+ q.expect('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED])
test_tube_caps_from_contact(q, bus, conn, stream, 'bilbo1 at foo.com/Foo')
diff --git a/tests/twisted/connect/test-nonblocking-tls.py b/tests/twisted/connect/test-nonblocking-tls.py
index dfabda6..370e1ca 100644
--- a/tests/twisted/connect/test-nonblocking-tls.py
+++ b/tests/twisted/connect/test-nonblocking-tls.py
@@ -15,6 +15,7 @@ from twisted.words.protocols.jabber import xmlstream
from gabbletest import (
make_connection, make_stream, XmppAuthenticator, XmppXmlStream,
disconnect_conn)
+import constants as cs
NS_XMPP_TLS = 'urn:ietf:params:xml:ns:xmpp-tls'
NS_XMPP_SASL = 'urn:ietf:params:xml:ns:xmpp-sasl'
@@ -66,7 +67,8 @@ class BlockForeverTlsAuthenticator(xmlstream.Authenticator):
def test(q, bus, conn1, conn2, stream1, stream2):
# Connection 1
conn1.Connect()
- q.expect('dbus-signal', signal='StatusChanged', args=[1, 1])
+ q.expect('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTING, cs.CSR_REQUESTED])
# Connection 1 blocks because the fake jabber server behind conn1 does not
# proceed to the tls handshake. The second connection is independant and
@@ -74,11 +76,13 @@ def test(q, bus, conn1, conn2, stream1, stream2):
# Connection 2
conn2.Connect()
- q.expect('dbus-signal', signal='StatusChanged', args=[1, 1])
+ q.expect('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTING, cs.CSR_REQUESTED])
q.expect('stream-authenticated')
q.expect('dbus-signal', signal='PresenceUpdate',
args=[{1L: (0L, {u'available': {}})}])
- q.expect('dbus-signal', signal='StatusChanged', args=[0, 1])
+ q.expect('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED])
# Disconnection 2
disconnect_conn(q, conn2, stream2)
diff --git a/tests/twisted/connect/test-twice.py b/tests/twisted/connect/test-twice.py
index 2ce6308..2dc06fb 100644
--- a/tests/twisted/connect/test-twice.py
+++ b/tests/twisted/connect/test-twice.py
@@ -12,23 +12,28 @@ import servicetest
from gabbletest import (
make_connection, make_stream, JabberAuthenticator, XmppAuthenticator,
XmppXmlStream, JabberXmlStream, disconnect_conn)
+import constants as cs
def test(q, bus, conn1, conn2, stream1, stream2):
# Connection 1
conn1.Connect()
- q.expect('dbus-signal', signal='StatusChanged', args=[1, 1])
+ q.expect('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTING, cs.CSR_REQUESTED])
q.expect('stream-authenticated')
q.expect('dbus-signal', signal='PresenceUpdate',
args=[{1L: (0L, {u'available': {}})}])
- q.expect('dbus-signal', signal='StatusChanged', args=[0, 1])
+ q.expect('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED])
# Connection 2
conn2.Connect()
- q.expect('dbus-signal', signal='StatusChanged', args=[1, 1])
+ q.expect('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTING, cs.CSR_REQUESTED])
q.expect('stream-authenticated')
q.expect('dbus-signal', signal='PresenceUpdate',
args=[{1L: (0L, {u'available': {}})}])
- q.expect('dbus-signal', signal='StatusChanged', args=[0, 1])
+ q.expect('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED])
# Disconnection 1
disconnect_conn(q, conn1, stream1)
diff --git a/tests/twisted/file-transfer/file_transfer_helper.py b/tests/twisted/file-transfer/file_transfer_helper.py
index 7c87a70..3a4f479 100644
--- a/tests/twisted/file-transfer/file_transfer_helper.py
+++ b/tests/twisted/file-transfer/file_transfer_helper.py
@@ -55,7 +55,8 @@ class FileTransferTest(object):
self.conn.Connect()
_, vcard_event, roster_event, disco_event = self.q.expect_many(
- EventPattern('dbus-signal', signal='StatusChanged', args=[0, 1]),
+ EventPattern('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED]),
EventPattern('stream-iq', to=None, query_ns='vcard-temp',
query_name='vCard'),
EventPattern('stream-iq', query_ns=ns.ROSTER),
diff --git a/tests/twisted/file-transfer/test-caps-file-transfer.py b/tests/twisted/file-transfer/test-caps-file-transfer.py
index 312c334..1197ee8 100644
--- a/tests/twisted/file-transfer/test-caps-file-transfer.py
+++ b/tests/twisted/file-transfer/test-caps-file-transfer.py
@@ -121,7 +121,8 @@ def test_ft_caps_to_contact(q, bus, conn, stream):
def test(q, bus, conn, stream):
conn.Connect()
- q.expect('dbus-signal', signal='StatusChanged', args=[0, 1])
+ q.expect('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED])
client = 'http://telepathy.freedesktop.org/fake-client'
diff --git a/tests/twisted/jingle/google-relay.py b/tests/twisted/jingle/google-relay.py
index 673c185..408d991 100644
--- a/tests/twisted/jingle/google-relay.py
+++ b/tests/twisted/jingle/google-relay.py
@@ -81,11 +81,13 @@ def test(q, bus, conn, stream, incoming=True, too_slow=None):
conn.Connect()
ji_event = q.expect_many(
- EventPattern('dbus-signal', signal='StatusChanged', args=[1, 1]),
+ EventPattern('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTING, cs.CSR_REQUESTED]),
EventPattern('stream-authenticated'),
EventPattern('dbus-signal', signal='PresenceUpdate',
args=[{1L: (0L, {u'available': {}})}]),
- EventPattern('dbus-signal', signal='StatusChanged', args=[0, 1]),
+ EventPattern('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED]),
# See: http://code.google.com/apis/talk/jep_extensions/jingleinfo.html
EventPattern('stream-iq', query_ns='google:jingleinfo',
diff --git a/tests/twisted/jingle/jingletest2.py b/tests/twisted/jingle/jingletest2.py
index 94ed8df..ee0d1d0 100644
--- a/tests/twisted/jingle/jingletest2.py
+++ b/tests/twisted/jingle/jingletest2.py
@@ -14,6 +14,7 @@ from servicetest import EventPattern
import dbus
import ns
import os
+import constants as cs
class JingleProtocol:
"""
@@ -392,11 +393,13 @@ class JingleTest2:
# If we don't catch the vCard query here, it can trip us up later:
# http://bugs.freedesktop.org/show_bug.cgi?id=19161
self.q.expect_many(
- EventPattern('dbus-signal', signal='StatusChanged', args=[1, 1]),
+ EventPattern('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTING, cs.CSR_REQUESTED]),
EventPattern('stream-authenticated'),
EventPattern('dbus-signal', signal='PresenceUpdate',
args=[{1L: (0L, {u'available': {}})}]),
- EventPattern('dbus-signal', signal='StatusChanged', args=[0, 1]),
+ EventPattern('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED]),
EventPattern('stream-iq', to=None, query_ns='vcard-temp',
query_name='vCard'),
)
diff --git a/tests/twisted/jingle/outgoing-many-streams.py b/tests/twisted/jingle/outgoing-many-streams.py
index 4cbe763..882bf7b 100644
--- a/tests/twisted/jingle/outgoing-many-streams.py
+++ b/tests/twisted/jingle/outgoing-many-streams.py
@@ -23,12 +23,14 @@ def test(q, bus, conn, stream):
# Connecting
conn.Connect()
- q.expect('dbus-signal', signal='StatusChanged', args=[1, 1])
+ q.expect('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTING, cs.CSR_REQUESTED])
q.expect('stream-authenticated')
q.expect('dbus-signal', signal='PresenceUpdate',
args=[{1L: (0L, {u'available': {}})}])
- q.expect('dbus-signal', signal='StatusChanged', args=[0, 1])
+ q.expect('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED])
self_handle = conn.GetSelfHandle()
diff --git a/tests/twisted/jingle/payload-types.py b/tests/twisted/jingle/payload-types.py
index a4f7937..0145d50 100644
--- a/tests/twisted/jingle/payload-types.py
+++ b/tests/twisted/jingle/payload-types.py
@@ -17,12 +17,14 @@ def test(q, bus, conn, stream):
# Connecting
conn.Connect()
- q.expect('dbus-signal', signal='StatusChanged', args=[1, 1])
+ q.expect('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTING, cs.CSR_REQUESTED])
q.expect('stream-authenticated')
q.expect('dbus-signal', signal='PresenceUpdate',
args=[{1L: (0L, {u'available': {}})}])
- q.expect('dbus-signal', signal='StatusChanged', args=[0, 1])
+ q.expect('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED])
self_handle = conn.GetSelfHandle()
diff --git a/tests/twisted/jingle/stream-handler-error.py b/tests/twisted/jingle/stream-handler-error.py
index c8f5f06..da80b49 100644
--- a/tests/twisted/jingle/stream-handler-error.py
+++ b/tests/twisted/jingle/stream-handler-error.py
@@ -17,7 +17,8 @@ def test(q, bus, conn, stream, call_error_on):
conn.Connect()
- q.expect('dbus-signal', signal='StatusChanged', args=[0, 1])
+ q.expect('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED])
remote_handle = conn.RequestHandles(1, ["foo at bar.com/Foo"])[0]
diff --git a/tests/twisted/jingle/stun-server.py b/tests/twisted/jingle/stun-server.py
index aa5f92e..68fae21 100644
--- a/tests/twisted/jingle/stun-server.py
+++ b/tests/twisted/jingle/stun-server.py
@@ -22,11 +22,13 @@ def test(q, bus, conn, stream,
conn.Connect()
q.expect_many(
- EventPattern('dbus-signal', signal='StatusChanged', args=[1, 1]),
+ EventPattern('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTING, cs.CSR_REQUESTED]),
EventPattern('stream-authenticated'),
EventPattern('dbus-signal', signal='PresenceUpdate',
args=[{1L: (0L, {u'available': {}})}]),
- EventPattern('dbus-signal', signal='StatusChanged', args=[0, 1]),
+ EventPattern('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED]),
)
if google:
diff --git a/tests/twisted/jingle/test-wait-for-caps-incomplete.py b/tests/twisted/jingle/test-wait-for-caps-incomplete.py
index f5f677f..91ef69f 100644
--- a/tests/twisted/jingle/test-wait-for-caps-incomplete.py
+++ b/tests/twisted/jingle/test-wait-for-caps-incomplete.py
@@ -15,12 +15,14 @@ def test(q, bus, conn, stream):
conn.Connect()
- q.expect('dbus-signal', signal='StatusChanged', args=[1, 1])
+ q.expect('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTING, cs.CSR_REQUESTED])
q.expect('stream-authenticated')
q.expect('dbus-signal', signal='PresenceUpdate',
args=[{1L: (0L, {u'available': {}})}])
- q.expect('dbus-signal', signal='StatusChanged', args=[0, 1])
+ q.expect('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED])
# We intentionally DON'T set remote presence yet. Since Gabble is still
# unsure whether to treat contact as offline for this purpose, it
diff --git a/tests/twisted/jingle/test-wait-for-caps.py b/tests/twisted/jingle/test-wait-for-caps.py
index 2b32add..89fb943 100644
--- a/tests/twisted/jingle/test-wait-for-caps.py
+++ b/tests/twisted/jingle/test-wait-for-caps.py
@@ -21,12 +21,14 @@ def test(q, bus, conn, stream):
conn.Connect()
- q.expect('dbus-signal', signal='StatusChanged', args=[1, 1])
+ q.expect('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTING, cs.CSR_REQUESTED])
q.expect('stream-authenticated')
q.expect('dbus-signal', signal='PresenceUpdate',
args=[{1L: (0L, {u'available': {}})}])
- q.expect('dbus-signal', signal='StatusChanged', args=[0, 1])
+ q.expect('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED])
run_test(q, bus, conn, stream, jt, True)
run_test(q, bus, conn, stream, jt2, False)
diff --git a/tests/twisted/muc/name-conflict.py b/tests/twisted/muc/name-conflict.py
index cc087a4..f3cd9df 100644
--- a/tests/twisted/muc/name-conflict.py
+++ b/tests/twisted/muc/name-conflict.py
@@ -16,11 +16,13 @@ from constants import (
CONN_IFACE_REQUESTS, CHANNEL_TYPE_TEXT, CHANNEL_IFACE_GROUP,
CHANNEL_TYPE, TARGET_HANDLE_TYPE, TARGET_HANDLE,
)
+import constants as cs
import ns
def test(q, bus, conn, stream):
conn.Connect()
- q.expect('dbus-signal', signal='StatusChanged', args=[0, 1])
+ q.expect('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED])
test_join(q, bus, conn, stream, 'chat at conf.localhost', False)
test_join(q, bus, conn, stream, 'chien at conf.localhost', True)
diff --git a/tests/twisted/muc/renamed.py b/tests/twisted/muc/renamed.py
index 8bdab0a..7255a30 100644
--- a/tests/twisted/muc/renamed.py
+++ b/tests/twisted/muc/renamed.py
@@ -13,10 +13,12 @@ from constants import (
CONN_IFACE_REQUESTS, CHANNEL_TYPE_TEXT, CHANNEL_IFACE_GROUP,
CHANNEL_TYPE, TARGET_HANDLE_TYPE, TARGET_HANDLE,
)
+import constants as cs
def test(q, bus, conn, stream):
conn.Connect()
- q.expect('dbus-signal', signal='StatusChanged', args=[0, 1])
+ q.expect('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED])
self_handle = conn.GetSelfHandle()
diff --git a/tests/twisted/muc/roomlist.py b/tests/twisted/muc/roomlist.py
index 2bcc21b..38e5cd1 100644
--- a/tests/twisted/muc/roomlist.py
+++ b/tests/twisted/muc/roomlist.py
@@ -8,12 +8,14 @@ import dbus
from gabbletest import make_result_iq, exec_test, sync_stream, disconnect_conn
from servicetest import call_async, EventPattern, \
tp_name_prefix, tp_path_prefix
+import constants as cs
def test(q, bus, conn, stream):
conn.Connect()
_, event = q.expect_many(
- EventPattern('dbus-signal', signal='StatusChanged', args=[0, 1]),
+ EventPattern('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED]),
EventPattern('stream-iq', to='localhost',
query_ns='http://jabber.org/protocol/disco#items'),
)
diff --git a/tests/twisted/muc/send-error.py b/tests/twisted/muc/send-error.py
index 2df0902..a778c2b 100644
--- a/tests/twisted/muc/send-error.py
+++ b/tests/twisted/muc/send-error.py
@@ -13,7 +13,8 @@ from mucutil import join_muc_and_check
def test(q, bus, conn, stream):
conn.Connect()
- q.expect('dbus-signal', signal='StatusChanged', args=[0, 1])
+ q.expect('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED])
muc = 'chat at conf.localhost'
_, text_chan, test_handle, bob_handle = \
diff --git a/tests/twisted/muc/test-ensure.py b/tests/twisted/muc/test-ensure.py
index 23e03f9..fb3064d 100644
--- a/tests/twisted/muc/test-ensure.py
+++ b/tests/twisted/muc/test-ensure.py
@@ -10,7 +10,8 @@ import constants as cs
def test(q, bus, conn, stream):
conn.Connect()
- q.expect('dbus-signal', signal='StatusChanged', args=[0, 1])
+ q.expect('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED])
# Need to call this asynchronously as it involves Gabble sending us a
# query.
diff --git a/tests/twisted/muc/test-muc-invitation.py b/tests/twisted/muc/test-muc-invitation.py
index 1d347e7..22f7f00 100644
--- a/tests/twisted/muc/test-muc-invitation.py
+++ b/tests/twisted/muc/test-muc-invitation.py
@@ -13,7 +13,8 @@ import constants as cs
def test(q, bus, conn, stream):
conn.Connect()
- q.expect('dbus-signal', signal='StatusChanged', args=[0, 1])
+ q.expect('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED])
# Bob has invited us to an activity.
message = domish.Element((None, 'message'))
diff --git a/tests/twisted/muc/test-muc-ownership.py b/tests/twisted/muc/test-muc-ownership.py
index 4181f32..362a16f 100644
--- a/tests/twisted/muc/test-muc-ownership.py
+++ b/tests/twisted/muc/test-muc-ownership.py
@@ -16,7 +16,8 @@ import constants as cs
def test(q, bus, conn, stream):
conn.Connect()
- q.expect('dbus-signal', signal='StatusChanged', args=[0, 1])
+ q.expect('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED])
# Need to call this asynchronously as it involves Gabble sending us a
# query
diff --git a/tests/twisted/muc/test-muc-properties.py b/tests/twisted/muc/test-muc-properties.py
index 8c68695..7cc8068 100644
--- a/tests/twisted/muc/test-muc-properties.py
+++ b/tests/twisted/muc/test-muc-properties.py
@@ -40,7 +40,8 @@ def handle_muc_get_iq(stream, stanza):
def test(q, bus, conn, stream):
conn.Connect()
- q.expect('dbus-signal', signal='StatusChanged', args=[0, 1])
+ q.expect('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED])
muc_handle = request_muc_handle(q, conn, stream, 'chat at conf.localhost')
call_async(q, conn, 'RequestChannel', cs.CHANNEL_TYPE_TEXT, cs.HT_ROOM,
diff --git a/tests/twisted/muc/test-muc.py b/tests/twisted/muc/test-muc.py
index 2c7cca1..21280e2 100644
--- a/tests/twisted/muc/test-muc.py
+++ b/tests/twisted/muc/test-muc.py
@@ -15,7 +15,8 @@ from mucutil import join_muc_and_check
def test(q, bus, conn, stream):
conn.Connect()
- q.expect('dbus-signal', signal='StatusChanged', args=[0, 1])
+ q.expect('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED])
room = 'chat at conf.localhost'
room_handle, chan, test_handle, bob_handle = \
diff --git a/tests/twisted/olpc/change-notifications.py b/tests/twisted/olpc/change-notifications.py
index dfa1bb8..724ab56 100644
--- a/tests/twisted/olpc/change-notifications.py
+++ b/tests/twisted/olpc/change-notifications.py
@@ -5,7 +5,7 @@ test OLPC Buddy properties change notifications
from servicetest import EventPattern
from gabbletest import exec_test, acknowledge_iq
-
+import constants as cs
from util import announce_gadget, send_buddy_changed_properties_msg
import ns
@@ -13,7 +13,8 @@ def test(q, bus, conn, stream):
conn.Connect()
_, iq_event, disco_event = q.expect_many(
- EventPattern('dbus-signal', signal='StatusChanged', args=[0, 1]),
+ EventPattern('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED]),
EventPattern('stream-iq', to=None, query_ns='vcard-temp',
query_name='vCard'),
EventPattern('stream-iq', to='localhost', query_ns=ns.DISCO_ITEMS))
diff --git a/tests/twisted/olpc/current-activity.py b/tests/twisted/olpc/current-activity.py
index d5378b4..cecb108 100644
--- a/tests/twisted/olpc/current-activity.py
+++ b/tests/twisted/olpc/current-activity.py
@@ -6,7 +6,7 @@ import dbus
from servicetest import call_async, EventPattern
from gabbletest import exec_test, acknowledge_iq
-
+import constants as cs
from util import (announce_gadget, send_buddy_changed_current_act_msg,
answer_to_current_act_pubsub_request, answer_error_to_pubsub_request,
send_gadget_current_activity_changed_msg, request_random_activity_view)
@@ -16,7 +16,8 @@ def test(q, bus, conn, stream):
conn.Connect()
_, iq_event, disco_event = q.expect_many(
- EventPattern('dbus-signal', signal='StatusChanged', args=[0, 1]),
+ EventPattern('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED]),
EventPattern('stream-iq', to=None, query_ns='vcard-temp',
query_name='vCard'),
EventPattern('stream-iq', to='localhost', query_ns=ns.DISCO_ITEMS))
diff --git a/tests/twisted/olpc/gadget-invite.py b/tests/twisted/olpc/gadget-invite.py
index d608161..362490a 100644
--- a/tests/twisted/olpc/gadget-invite.py
+++ b/tests/twisted/olpc/gadget-invite.py
@@ -41,7 +41,8 @@ def test(q, bus, conn, stream):
conn.Connect()
_, iq_event, disco_event = q.expect_many(
- EventPattern('dbus-signal', signal='StatusChanged', args=[0, 1]),
+ EventPattern('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED]),
EventPattern('stream-iq', to=None, query_ns='vcard-temp',
query_name='vCard'),
EventPattern('stream-iq', to='localhost', query_ns=ns.DISCO_ITEMS))
diff --git a/tests/twisted/olpc/gadget-publish.py b/tests/twisted/olpc/gadget-publish.py
index f50fd0c..a2a9013 100644
--- a/tests/twisted/olpc/gadget-publish.py
+++ b/tests/twisted/olpc/gadget-publish.py
@@ -6,7 +6,7 @@ import dbus
from servicetest import EventPattern
from gabbletest import exec_test, acknowledge_iq
-
+import constants as cs
from util import announce_gadget, gadget_publish
import ns
@@ -14,7 +14,8 @@ def test(q, bus, conn, stream):
conn.Connect()
_, iq_event, disco_event = q.expect_many(
- EventPattern('dbus-signal', signal='StatusChanged', args=[0, 1]),
+ EventPattern('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED]),
EventPattern('stream-iq', to=None, query_ns='vcard-temp',
query_name='vCard'),
EventPattern('stream-iq', to='localhost', query_ns=ns.DISCO_ITEMS))
diff --git a/tests/twisted/olpc/gadget-restarted.py b/tests/twisted/olpc/gadget-restarted.py
index 603823a..beaf45e 100644
--- a/tests/twisted/olpc/gadget-restarted.py
+++ b/tests/twisted/olpc/gadget-restarted.py
@@ -17,7 +17,8 @@ def test(q, bus, conn, stream):
handles = {}
_, iq_event, disco_event = q.expect_many(
- EventPattern('dbus-signal', signal='StatusChanged', args=[0, 1]),
+ EventPattern('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED]),
EventPattern('stream-iq', to=None, query_ns='vcard-temp',
query_name='vCard'),
EventPattern('stream-iq', to='localhost', query_ns=ns.DISCO_ITEMS))
diff --git a/tests/twisted/olpc/olpc-activity-search.py b/tests/twisted/olpc/olpc-activity-search.py
index 659bc7a..9e16301 100644
--- a/tests/twisted/olpc/olpc-activity-search.py
+++ b/tests/twisted/olpc/olpc-activity-search.py
@@ -35,7 +35,8 @@ def test(q, bus, conn, stream):
handles = {}
_, iq_event, disco_event = q.expect_many(
- EventPattern('dbus-signal', signal='StatusChanged', args=[0, 1]),
+ EventPattern('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED]),
EventPattern('stream-iq', to=None, query_ns='vcard-temp',
query_name='vCard'),
EventPattern('stream-iq', to='localhost', query_ns=ns.DISCO_ITEMS))
diff --git a/tests/twisted/olpc/olpc-buddy-search.py b/tests/twisted/olpc/olpc-buddy-search.py
index a2c8e71..a18a44b 100644
--- a/tests/twisted/olpc/olpc-buddy-search.py
+++ b/tests/twisted/olpc/olpc-buddy-search.py
@@ -22,7 +22,8 @@ def test(q, bus, conn, stream):
conn.Connect()
_, iq_event, disco_event = q.expect_many(
- EventPattern('dbus-signal', signal='StatusChanged', args=[0, 1]),
+ EventPattern('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED]),
EventPattern('stream-iq', to=None, query_ns='vcard-temp',
query_name='vCard'),
EventPattern('stream-iq', to='localhost', query_ns=ns.DISCO_ITEMS))
diff --git a/tests/twisted/olpc/olpc-muc-invitation.py b/tests/twisted/olpc/olpc-muc-invitation.py
index 014206a..0cbc441 100644
--- a/tests/twisted/olpc/olpc-muc-invitation.py
+++ b/tests/twisted/olpc/olpc-muc-invitation.py
@@ -14,7 +14,8 @@ import ns
def test(q, bus, conn, stream):
conn.Connect()
- q.expect('dbus-signal', signal='StatusChanged', args=[0, 1])
+ q.expect('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED])
handles = {}
handles['bob'] = conn.RequestHandles(1, ['bob at localhost'])[0]
diff --git a/tests/twisted/olpc/olpc-muc-prop-change.py b/tests/twisted/olpc/olpc-muc-prop-change.py
index 793224a..58a33ca 100644
--- a/tests/twisted/olpc/olpc-muc-prop-change.py
+++ b/tests/twisted/olpc/olpc-muc-prop-change.py
@@ -15,7 +15,8 @@ def test(q, bus, conn, stream):
conn.Connect()
_, iq_event = q.expect_many(
- EventPattern('dbus-signal', signal='StatusChanged', args=[0, 1]),
+ EventPattern('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED]),
EventPattern('stream-iq', to=None, query_ns='vcard-temp',
query_name='vCard'))
diff --git a/tests/twisted/olpc/test-olpc-bundle.py b/tests/twisted/olpc/test-olpc-bundle.py
index 0d56b66..e370f84 100644
--- a/tests/twisted/olpc/test-olpc-bundle.py
+++ b/tests/twisted/olpc/test-olpc-bundle.py
@@ -7,6 +7,7 @@ from gabbletest import exec_test, acknowledge_iq
from twisted.words.xish import domish, xpath
import ns
+import constants as cs
olpc_features = set([ns.OLPC_BUDDY_PROPS_NOTIFY, ns.OLPC_ACTIVITIES_NOTIFY,
ns.OLPC_CURRENT_ACTIVITY_NOTIFY, ns.OLPC_ACTIVITY_PROPS_NOTIFY])
@@ -15,7 +16,8 @@ def test(q, bus, conn, stream):
conn.Connect()
_, iq_event = q.expect_many(
- EventPattern('dbus-signal', signal='StatusChanged', args=[0, 1]),
+ EventPattern('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED]),
EventPattern('stream-iq', to=None, query_ns='vcard-temp',
query_name='vCard'))
diff --git a/tests/twisted/olpc/test-olpc-set-props-preload.py b/tests/twisted/olpc/test-olpc-set-props-preload.py
index 5f696c0..933975d 100644
--- a/tests/twisted/olpc/test-olpc-set-props-preload.py
+++ b/tests/twisted/olpc/test-olpc-set-props-preload.py
@@ -14,7 +14,6 @@ def test(q, bus, conn, stream):
buddy_info_iface.SetProperties({'color': '#ff0000,#0000ff'})
conn.Connect()
- # q.expect('dbus-signal', signal='StatusChanged', args=[0, 1])
# buddy activities
event = q.expect('stream-iq', iq_type='set', query_name='pubsub')
diff --git a/tests/twisted/olpc/view-presence.py b/tests/twisted/olpc/view-presence.py
index fc80bf5..97ca302 100644
--- a/tests/twisted/olpc/view-presence.py
+++ b/tests/twisted/olpc/view-presence.py
@@ -34,7 +34,8 @@ def test(q, bus, conn, stream):
conn.Connect()
_, iq_event, disco_event = q.expect_many(
- EventPattern('dbus-signal', signal='StatusChanged', args=[0, 1]),
+ EventPattern('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED]),
EventPattern('stream-iq', to=None, query_ns='vcard-temp',
query_name='vCard'),
EventPattern('stream-iq', to='localhost', query_ns=ns.DISCO_ITEMS))
diff --git a/tests/twisted/presence/presence.py b/tests/twisted/presence/presence.py
index 5789fb8..8eb802f 100644
--- a/tests/twisted/presence/presence.py
+++ b/tests/twisted/presence/presence.py
@@ -8,10 +8,12 @@ from twisted.words.xish import domish
from gabbletest import exec_test
import ns
+import constants as cs
def test(q, bus, conn, stream):
conn.Connect()
- q.expect('dbus-signal', signal='StatusChanged', args=[0, 1])
+ q.expect('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED])
amy_handle = conn.RequestHandles(1, ['amy at foo.com'])[0]
diff --git a/tests/twisted/roster/ensure.py b/tests/twisted/roster/ensure.py
index 752bac0..7a63f26 100644
--- a/tests/twisted/roster/ensure.py
+++ b/tests/twisted/roster/ensure.py
@@ -9,7 +9,6 @@ import ns
def test(q, bus, conn, stream):
conn.Connect()
- # q.expect('dbus-signal', signal='StatusChanged', args=[0, 1])
roster_event = q.expect('stream-iq', query_ns=ns.ROSTER)
roster_event.stanza['type'] = 'result'
diff --git a/tests/twisted/roster/groups-12791.py b/tests/twisted/roster/groups-12791.py
index f028b96..682faad 100644
--- a/tests/twisted/roster/groups-12791.py
+++ b/tests/twisted/roster/groups-12791.py
@@ -22,7 +22,6 @@ def _expect_group_channel(q, bus, conn, name, contacts):
def test(q, bus, conn, stream):
conn.Connect()
- # q.expect('dbus-signal', signal='StatusChanged', args=[0, 1])
event = q.expect('stream-iq', query_ns=ns.ROSTER)
event.stanza['type'] = 'result'
diff --git a/tests/twisted/roster/groups.py b/tests/twisted/roster/groups.py
index e6cb214..649fcc6 100644
--- a/tests/twisted/roster/groups.py
+++ b/tests/twisted/roster/groups.py
@@ -10,7 +10,6 @@ import ns
def test(q, bus, conn, stream):
conn.Connect()
- # q.expect('dbus-signal', signal='StatusChanged', args=[0, 1])
event = q.expect('stream-iq', query_ns=ns.ROSTER)
event.stanza['type'] = 'result'
diff --git a/tests/twisted/roster/request-group-after-roster.py b/tests/twisted/roster/request-group-after-roster.py
index 3eb3df2..cc36276 100644
--- a/tests/twisted/roster/request-group-after-roster.py
+++ b/tests/twisted/roster/request-group-after-roster.py
@@ -10,7 +10,6 @@ import ns
def test(q, bus, conn, stream):
conn.Connect()
- # q.expect('dbus-signal', signal='StatusChanged', args=[0, 1])
roster_event = q.expect('stream-iq', query_ns=ns.ROSTER)
roster_event.stanza['type'] = 'result'
diff --git a/tests/twisted/roster/request-group-before-roster.py b/tests/twisted/roster/request-group-before-roster.py
index 0b72970..0766ef5 100644
--- a/tests/twisted/roster/request-group-before-roster.py
+++ b/tests/twisted/roster/request-group-before-roster.py
@@ -10,7 +10,6 @@ import ns
def test(q, bus, conn, stream):
conn.Connect()
- # q.expect('dbus-signal', signal='StatusChanged', args=[0, 1])
roster_event = q.expect('stream-iq', query_ns=ns.ROSTER)
roster_event.stanza['type'] = 'result'
diff --git a/tests/twisted/roster/test-roster.py b/tests/twisted/roster/test-roster.py
index b7c4da4..396bf99 100644
--- a/tests/twisted/roster/test-roster.py
+++ b/tests/twisted/roster/test-roster.py
@@ -9,7 +9,6 @@ import ns
def test(q, bus, conn, stream):
conn.Connect()
- # q.expect('dbus-signal', signal='StatusChanged', args=[0, 1])
event = q.expect('stream-iq', query_ns=ns.ROSTER)
event.stanza['type'] = 'result'
diff --git a/tests/twisted/roster/test-save-alias-to-roster.py b/tests/twisted/roster/test-save-alias-to-roster.py
index dc08e5a..74c3581 100644
--- a/tests/twisted/roster/test-save-alias-to-roster.py
+++ b/tests/twisted/roster/test-save-alias-to-roster.py
@@ -13,7 +13,8 @@ import ns
def test(q, bus, conn, stream):
conn.Connect()
_, event, event2 = q.expect_many(
- EventPattern('dbus-signal', signal='StatusChanged', args=[0, 1]),
+ EventPattern('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED]),
EventPattern('stream-iq', to=None, query_ns='vcard-temp',
query_name='vCard'),
EventPattern('stream-iq', query_ns=ns.ROSTER))
diff --git a/tests/twisted/test-debug.py b/tests/twisted/test-debug.py
index ba39ab8..1dba11f 100644
--- a/tests/twisted/test-debug.py
+++ b/tests/twisted/test-debug.py
@@ -33,7 +33,8 @@ def test(q, bus, conn, stream):
assert len(messages) == 0
conn.Connect()
- q.expect('dbus-signal', signal='StatusChanged', args=[0, 1])
+ q.expect('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED])
assert props_iface.Get(iface, 'Enabled') == False
props_iface.Set(iface, 'Enabled', True)
diff --git a/tests/twisted/test-disco-no-reply.py b/tests/twisted/test-disco-no-reply.py
index 1e33e43..75ea29b 100644
--- a/tests/twisted/test-disco-no-reply.py
+++ b/tests/twisted/test-disco-no-reply.py
@@ -5,15 +5,18 @@ to its service discovery request
"""
from gabbletest import exec_test, XmppXmlStream
+import constants as cs
def test(q, bus, conn, stream):
conn.Connect()
# connecting
- q.expect('dbus-signal', signal='StatusChanged', args=[1, 1])
+ q.expect('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTING, cs.CSR_REQUESTED]),
# We are disconnected with Connection_Status_Reason_Network_Error as the
# disco request timed out
- q.expect('dbus-signal', signal='StatusChanged', args=[2, 2])
+ q.expect('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_DISCONNECTED, cs.CSR_NETWORK_ERROR]),
class JabberXmlStreamNoDiscoReply (XmppXmlStream):
"""Subclass XmppXmlStream to don't automatically send a disco reply"""
diff --git a/tests/twisted/test-disco.py b/tests/twisted/test-disco.py
index c9a1dee..b241892 100644
--- a/tests/twisted/test-disco.py
+++ b/tests/twisted/test-disco.py
@@ -6,10 +6,12 @@ Test that Gabble responds to disco#info queries.
from twisted.words.xish import domish
from gabbletest import exec_test
+import constants as cs
def test(q, bus, conn, stream):
conn.Connect()
- q.expect('dbus-signal', signal='StatusChanged', args=[0, 1])
+ q.expect('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED])
m = domish.Element((None, 'iq'))
m['from'] = 'foo at bar.com'
diff --git a/tests/twisted/test-fallback-socks5-proxy.py b/tests/twisted/test-fallback-socks5-proxy.py
index e3357a8..73a98f7 100644
--- a/tests/twisted/test-fallback-socks5-proxy.py
+++ b/tests/twisted/test-fallback-socks5-proxy.py
@@ -13,7 +13,8 @@ def test(q, bus, conn, stream):
conn.Connect()
_, e1, e2 = q.expect_many(
- EventPattern('dbus-signal', signal='StatusChanged', args=[0, 1]),
+ EventPattern('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED]),
EventPattern('stream-iq', to='fallback1-proxy.localhost', iq_type='get', query_ns=ns.BYTESTREAMS),
EventPattern('stream-iq', to='fallback2-proxy.localhost', iq_type='get', query_ns=ns.BYTESTREAMS),
)
diff --git a/tests/twisted/test-location.py b/tests/twisted/test-location.py
index 38e92fb..721fa90 100644
--- a/tests/twisted/test-location.py
+++ b/tests/twisted/test-location.py
@@ -23,7 +23,9 @@ def test(q, bus, conn, stream):
q.expect_many(
EventPattern('stream-iq', iq_type='set',
query_ns='http://jabber.org/protocol/pubsub'),
- EventPattern('dbus-signal', signal='StatusChanged', args=[0, 1]))
+ EventPattern('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED]),
+ )
# check location properties
diff --git a/tests/twisted/test-set-status-idempotence.py b/tests/twisted/test-set-status-idempotence.py
index e440b13..ffd8cde 100644
--- a/tests/twisted/test-set-status-idempotence.py
+++ b/tests/twisted/test-set-status-idempotence.py
@@ -13,7 +13,8 @@ def test_presence(q, bus, conn, stream):
conn.Connect()
q.expect_many(
- EventPattern('dbus-signal', signal='StatusChanged', args=[0, 1]),
+ EventPattern('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED]),
EventPattern('stream-presence'))
iface = dbus.Interface (conn,
@@ -31,7 +32,8 @@ def test_simple_presence(q, bus, conn, stream):
conn.Connect()
q.expect_many(
- EventPattern('dbus-signal', signal='StatusChanged', args=[0, 1]),
+ EventPattern('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED]),
EventPattern('stream-presence'))
iface = dbus.Interface (conn, cs.CONN_IFACE_SIMPLE_PRESENCE)
diff --git a/tests/twisted/text/destroy.py b/tests/twisted/text/destroy.py
index 3f947aa..23398ce 100644
--- a/tests/twisted/text/destroy.py
+++ b/tests/twisted/text/destroy.py
@@ -13,7 +13,8 @@ import constants as cs
def test(q, bus, conn, stream):
conn.Connect()
- q.expect('dbus-signal', signal='StatusChanged', args=[0, 1])
+ q.expect('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED])
self_handle = conn.GetSelfHandle()
diff --git a/tests/twisted/text/ensure.py b/tests/twisted/text/ensure.py
index 8ada280..5fdf4bf 100644
--- a/tests/twisted/text/ensure.py
+++ b/tests/twisted/text/ensure.py
@@ -10,7 +10,8 @@ import constants as cs
def test(q, bus, conn, stream):
conn.Connect()
- q.expect('dbus-signal', signal='StatusChanged', args=[0, 1])
+ q.expect('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED])
self_handle = conn.GetSelfHandle()
diff --git a/tests/twisted/text/initiate-requestotron.py b/tests/twisted/text/initiate-requestotron.py
index f7d32b0..75ef7c0 100644
--- a/tests/twisted/text/initiate-requestotron.py
+++ b/tests/twisted/text/initiate-requestotron.py
@@ -10,7 +10,8 @@ import constants as cs
def test(q, bus, conn, stream):
conn.Connect()
- q.expect('dbus-signal', signal='StatusChanged', args=[0, 1])
+ q.expect('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED])
self_handle = conn.GetSelfHandle()
diff --git a/tests/twisted/text/initiate.py b/tests/twisted/text/initiate.py
index 5875e61..dae48e5 100644
--- a/tests/twisted/text/initiate.py
+++ b/tests/twisted/text/initiate.py
@@ -12,7 +12,8 @@ import constants as cs
def test(q, bus, conn, stream):
conn.Connect()
- q.expect('dbus-signal', signal='StatusChanged', args=[0, 1])
+ q.expect('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED])
self_handle = conn.GetSelfHandle()
diff --git a/tests/twisted/text/respawn.py b/tests/twisted/text/respawn.py
index db9f1ed..1dfd4fc 100644
--- a/tests/twisted/text/respawn.py
+++ b/tests/twisted/text/respawn.py
@@ -12,7 +12,8 @@ import constants as cs
def test(q, bus, conn, stream):
conn.Connect()
- q.expect('dbus-signal', signal='StatusChanged', args=[0, 1])
+ q.expect('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED])
self_handle = conn.GetSelfHandle()
diff --git a/tests/twisted/text/send-error.py b/tests/twisted/text/send-error.py
index b15d5ad..039223c 100644
--- a/tests/twisted/text/send-error.py
+++ b/tests/twisted/text/send-error.py
@@ -174,7 +174,8 @@ def test_permanent_error(q, bus, conn, stream):
def test(q, bus, conn, stream):
conn.Connect()
- q.expect('dbus-signal', signal='StatusChanged', args=[0, 1])
+ q.expect('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED])
test_temporary_error(q, bus, conn, stream)
test_permanent_error(q, bus, conn, stream)
diff --git a/tests/twisted/text/send-to-correct-resource.py b/tests/twisted/text/send-to-correct-resource.py
index 52c5c95..4668d8a 100644
--- a/tests/twisted/text/send-to-correct-resource.py
+++ b/tests/twisted/text/send-to-correct-resource.py
@@ -11,7 +11,8 @@ import ns
def test(q, bus, conn, stream):
conn.Connect()
- q.expect('dbus-signal', signal='StatusChanged', args=[0, 1])
+ q.expect('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED])
# <wjt> I need a random name generator
# <fledermaus> Macro-Variable Spin Gel
diff --git a/tests/twisted/text/test-chat-state.py b/tests/twisted/text/test-chat-state.py
index b8688b1..8f690a9 100644
--- a/tests/twisted/text/test-chat-state.py
+++ b/tests/twisted/text/test-chat-state.py
@@ -24,7 +24,8 @@ def check_state_notification(elem, name):
def test(q, bus, conn, stream):
conn.Connect()
- q.expect('dbus-signal', signal='StatusChanged', args=[0, 1])
+ q.expect('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED])
self_handle = conn.GetSelfHandle()
diff --git a/tests/twisted/text/test-text-delayed.py b/tests/twisted/text/test-text-delayed.py
index 807b01b..1a652cf 100644
--- a/tests/twisted/text/test-text-delayed.py
+++ b/tests/twisted/text/test-text-delayed.py
@@ -13,7 +13,8 @@ import constants as cs
def test(q, bus, conn, stream):
conn.Connect()
- q.expect('dbus-signal', signal='StatusChanged', args=[0, 1])
+ q.expect('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED])
m = domish.Element((None, 'message'))
m['from'] = 'foo at bar.com'
diff --git a/tests/twisted/text/test-text-no-body.py b/tests/twisted/text/test-text-no-body.py
index 89b4786..09ae6f4 100644
--- a/tests/twisted/text/test-text-no-body.py
+++ b/tests/twisted/text/test-text-no-body.py
@@ -12,7 +12,8 @@ import ns
def test(q, bus, conn, stream):
conn.Connect()
- q.expect('dbus-signal', signal='StatusChanged', args=[0, 1])
+ q.expect('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED])
# message without body
m = domish.Element((None, 'message'))
diff --git a/tests/twisted/text/test-text.py b/tests/twisted/text/test-text.py
index 828902e..401bf11 100644
--- a/tests/twisted/text/test-text.py
+++ b/tests/twisted/text/test-text.py
@@ -13,7 +13,8 @@ import constants as cs
def test(q, bus, conn, stream):
conn.Connect()
- q.expect('dbus-signal', signal='StatusChanged', args=[0, 1])
+ q.expect('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED])
# <message type="chat"><body>hello</body</message>
m = domish.Element((None, 'message'))
diff --git a/tests/twisted/tubes/accept-muc-dbus-tube.py b/tests/twisted/tubes/accept-muc-dbus-tube.py
index 77226ca..ded65f6 100644
--- a/tests/twisted/tubes/accept-muc-dbus-tube.py
+++ b/tests/twisted/tubes/accept-muc-dbus-tube.py
@@ -2,7 +2,7 @@ import dbus
from servicetest import call_async, EventPattern
from gabbletest import exec_test, acknowledge_iq, make_muc_presence
-import constants as c
+import constants as cs
from twisted.words.xish import xpath
import ns
@@ -13,7 +13,8 @@ def test(q, bus, conn, stream, access_control):
conn.Connect()
_, iq_event = q.expect_many(
- EventPattern('dbus-signal', signal='StatusChanged', args=[0, 1]),
+ EventPattern('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED]),
EventPattern('stream-iq', to=None, query_ns='vcard-temp',
query_name='vCard'))
@@ -51,31 +52,31 @@ def test(q, bus, conn, stream, access_control):
channels = event.args[0]
path, props = channels[0]
- assert props[c.CHANNEL_TYPE] == c.CHANNEL_TYPE_DBUS_TUBE
- assert props[c.INITIATOR_ID] == 'chat at conf.localhost/bob'
- bob_handle = props[c.INITIATOR_HANDLE]
- assert props[c.INTERFACES] == [c.CHANNEL_IFACE_GROUP, c.CHANNEL_IFACE_TUBE]
- assert props[c.REQUESTED] == False
- assert props[c.TARGET_ID] == 'chat at conf.localhost'
- assert props[c.DBUS_TUBE_SERVICE_NAME] == 'com.example.Test'
- assert props[c.TUBE_PARAMETERS] == {'foo': 'bar'}
- assert props[c.DBUS_TUBE_SUPPORTED_ACCESS_CONTROLS] == [c.SOCKET_ACCESS_CONTROL_CREDENTIALS,
- c.SOCKET_ACCESS_CONTROL_LOCALHOST]
+ assert props[cs.CHANNEL_TYPE] == cs.CHANNEL_TYPE_DBUS_TUBE
+ assert props[cs.INITIATOR_ID] == 'chat at conf.localhost/bob'
+ bob_handle = props[cs.INITIATOR_HANDLE]
+ assert props[cs.INTERFACES] == [cs.CHANNEL_IFACE_GROUP, cs.CHANNEL_IFACE_TUBE]
+ assert props[cs.REQUESTED] == False
+ assert props[cs.TARGET_ID] == 'chat at conf.localhost'
+ assert props[cs.DBUS_TUBE_SERVICE_NAME] == 'com.example.Test'
+ assert props[cs.TUBE_PARAMETERS] == {'foo': 'bar'}
+ assert props[cs.DBUS_TUBE_SUPPORTED_ACCESS_CONTROLS] == [cs.SOCKET_ACCESS_CONTROL_CREDENTIALS,
+ cs.SOCKET_ACCESS_CONTROL_LOCALHOST]
tube_chan = bus.get_object(conn.bus_name, path)
- tube_iface = dbus.Interface(tube_chan, c.CHANNEL_IFACE_TUBE)
- dbus_tube_iface = dbus.Interface(tube_chan, c.CHANNEL_TYPE_DBUS_TUBE)
- tube_chan_iface = dbus.Interface(tube_chan, c.CHANNEL)
+ tube_iface = dbus.Interface(tube_chan, cs.CHANNEL_IFACE_TUBE)
+ dbus_tube_iface = dbus.Interface(tube_chan, cs.CHANNEL_TYPE_DBUS_TUBE)
+ tube_chan_iface = dbus.Interface(tube_chan, cs.CHANNEL)
# only Bob is in DBusNames
- dbus_names = tube_chan.Get(c.CHANNEL_TYPE_DBUS_TUBE, 'DBusNames', dbus_interface=c.PROPERTIES_IFACE)
+ dbus_names = tube_chan.Get(cs.CHANNEL_TYPE_DBUS_TUBE, 'DBusNames', dbus_interface=cs.PROPERTIES_IFACE)
assert dbus_names == {bob_handle: bob_bus_name}
call_async(q, dbus_tube_iface, 'Accept', access_control)
return_event, names_changed, presence_event = q.expect_many(
EventPattern('dbus-return', method='Accept'),
- EventPattern('dbus-signal', signal='DBusNamesChanged', interface=c.CHANNEL_TYPE_DBUS_TUBE),
+ EventPattern('dbus-signal', signal='DBusNamesChanged', interface=cs.CHANNEL_TYPE_DBUS_TUBE),
EventPattern('stream-presence', to='chat at conf.localhost/test'))
tube_addr = return_event.value[0]
@@ -90,11 +91,11 @@ def test(q, bus, conn, stream, access_control):
assert tube_node['id'] == '1'
self_bus_name = tube_node['dbus-name']
- tubes_self_handle = tube_chan.GetSelfHandle(dbus_interface=c.CHANNEL_IFACE_GROUP)
+ tubes_self_handle = tube_chan.GetSelfHandle(dbus_interface=cs.CHANNEL_IFACE_GROUP)
assert tubes_self_handle != 0
# both of us are in DBusNames now
- dbus_names = tube_chan.Get(c.CHANNEL_TYPE_DBUS_TUBE, 'DBusNames', dbus_interface=c.PROPERTIES_IFACE)
+ dbus_names = tube_chan.Get(cs.CHANNEL_TYPE_DBUS_TUBE, 'DBusNames', dbus_interface=cs.PROPERTIES_IFACE)
assert dbus_names == {bob_handle: bob_bus_name, tubes_self_handle: self_bus_name}
added, removed = names_changed.args
@@ -109,6 +110,6 @@ def test(q, bus, conn, stream, access_control):
if __name__ == '__main__':
# We can't use t.exec_dbus_tube_test() as we can use only the muc bytestream
exec_test(lambda q, bus, conn, stream:
- test(q, bus, conn, stream, c.SOCKET_ACCESS_CONTROL_CREDENTIALS))
+ test(q, bus, conn, stream, cs.SOCKET_ACCESS_CONTROL_CREDENTIALS))
exec_test(lambda q, bus, conn, stream:
- test(q, bus, conn, stream, c.SOCKET_ACCESS_CONTROL_LOCALHOST))
+ test(q, bus, conn, stream, cs.SOCKET_ACCESS_CONTROL_LOCALHOST))
diff --git a/tests/twisted/tubes/accept-muc-stream-tube.py b/tests/twisted/tubes/accept-muc-stream-tube.py
index 339aa71..172cff4 100644
--- a/tests/twisted/tubes/accept-muc-stream-tube.py
+++ b/tests/twisted/tubes/accept-muc-stream-tube.py
@@ -29,7 +29,8 @@ def test(q, bus, conn, stream, bytestream_cls,
conn.Connect()
_, iq_event, disco_event = q.expect_many(
- EventPattern('dbus-signal', signal='StatusChanged', args=[0, 1]),
+ EventPattern('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED]),
EventPattern('stream-iq', to=None, query_ns='vcard-temp',
query_name='vCard'),
EventPattern('stream-iq', to='localhost', query_ns=ns.DISCO_ITEMS))
diff --git a/tests/twisted/tubes/accept-private-dbus-tube.py b/tests/twisted/tubes/accept-private-dbus-tube.py
index 35fed9a..0e02183 100644
--- a/tests/twisted/tubes/accept-private-dbus-tube.py
+++ b/tests/twisted/tubes/accept-private-dbus-tube.py
@@ -31,7 +31,8 @@ def test(q, bus, conn, stream, bytestream_cls, access_control):
conn.Connect()
_, vcard_event, roster_event = q.expect_many(
- EventPattern('dbus-signal', signal='StatusChanged', args=[0, 1]),
+ EventPattern('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED]),
EventPattern('stream-iq', to=None, query_ns='vcard-temp',
query_name='vCard'),
EventPattern('stream-iq', query_ns=ns.ROSTER))
diff --git a/tests/twisted/tubes/accept-private-stream-tube.py b/tests/twisted/tubes/accept-private-stream-tube.py
index f5682e5..832ff72 100644
--- a/tests/twisted/tubes/accept-private-stream-tube.py
+++ b/tests/twisted/tubes/accept-private-stream-tube.py
@@ -115,7 +115,8 @@ def test(q, bus, conn, stream, bytestream_cls,
conn.Connect()
_, vcard_event, roster_event, disco_event = q.expect_many(
- EventPattern('dbus-signal', signal='StatusChanged', args=[0, 1]),
+ EventPattern('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED]),
EventPattern('stream-iq', to=None, query_ns='vcard-temp',
query_name='vCard'),
EventPattern('stream-iq', query_ns=ns.ROSTER),
diff --git a/tests/twisted/tubes/close-muc-with-closed-tube.py b/tests/twisted/tubes/close-muc-with-closed-tube.py
index 86c8ae6..d0a8b11 100644
--- a/tests/twisted/tubes/close-muc-with-closed-tube.py
+++ b/tests/twisted/tubes/close-muc-with-closed-tube.py
@@ -19,7 +19,8 @@ def test(q, bus, conn, stream):
conn.Connect()
_, iq_event = q.expect_many(
- EventPattern('dbus-signal', signal='StatusChanged', args=[0, 1]),
+ EventPattern('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED]),
EventPattern('stream-iq', to=None, query_ns='vcard-temp',
query_name='vCard'))
diff --git a/tests/twisted/tubes/crash-on-list-channels.py b/tests/twisted/tubes/crash-on-list-channels.py
index 3198d9d..0d4a3ad 100644
--- a/tests/twisted/tubes/crash-on-list-channels.py
+++ b/tests/twisted/tubes/crash-on-list-channels.py
@@ -18,7 +18,8 @@ jid = 'explosions at in.the.sky'
def test(q, bus, conn, stream):
conn.Connect()
_, roster_event = q.expect_many(
- EventPattern('dbus-signal', signal='StatusChanged', args=[0, 1]),
+ EventPattern('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED]),
EventPattern('stream-iq', query_ns=ns.ROSTER))
roster = roster_event.stanza
diff --git a/tests/twisted/tubes/create-invalid-tube-channels.py b/tests/twisted/tubes/create-invalid-tube-channels.py
index 4fd97d2..b2e8523 100644
--- a/tests/twisted/tubes/create-invalid-tube-channels.py
+++ b/tests/twisted/tubes/create-invalid-tube-channels.py
@@ -20,7 +20,8 @@ def check_no_tubes(conn_props):
def test(q, bus, conn, stream):
conn.Connect()
- q.expect('dbus-signal', signal='StatusChanged', args=[0, 1]),
+ q.expect('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED])
conn_props = dbus.Interface(conn, cs.PROPERTIES_IFACE)
diff --git a/tests/twisted/tubes/ensure-si-tube.py b/tests/twisted/tubes/ensure-si-tube.py
index ac814e6..fce3c70 100644
--- a/tests/twisted/tubes/ensure-si-tube.py
+++ b/tests/twisted/tubes/ensure-si-tube.py
@@ -35,7 +35,8 @@ def test(q, bus, conn, stream):
properties['RequestableChannelClasses']
_, vcard_event, roster_event = q.expect_many(
- EventPattern('dbus-signal', signal='StatusChanged', args=[0, 1]),
+ EventPattern('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED]),
EventPattern('stream-iq', to=None, query_ns='vcard-temp',
query_name='vCard'),
EventPattern('stream-iq', query_ns=ns.ROSTER))
diff --git a/tests/twisted/tubes/muc-presence.py b/tests/twisted/tubes/muc-presence.py
index 85769ca..07e25ed 100644
--- a/tests/twisted/tubes/muc-presence.py
+++ b/tests/twisted/tubes/muc-presence.py
@@ -5,13 +5,15 @@ GabbleTubesChannel, crashing Gabble.
"""
from gabbletest import exec_test
+import constants as cs
from muctubeutil import get_muc_tubes_channel
def test(q, bus, conn, stream):
conn.Connect()
- _ = q.expect('dbus-signal', signal='StatusChanged', args=[0, 1])
+ _ = q.expect('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED])
handle, tubes_chan, tubes_iface = get_muc_tubes_channel(q, bus, conn,
stream, 'chat at conf.localhost')
diff --git a/tests/twisted/tubes/offer-muc-dbus-tube.py b/tests/twisted/tubes/offer-muc-dbus-tube.py
index c2ee88d..a06a004 100644
--- a/tests/twisted/tubes/offer-muc-dbus-tube.py
+++ b/tests/twisted/tubes/offer-muc-dbus-tube.py
@@ -91,7 +91,8 @@ def test(q, bus, conn, stream, access_control):
conn.Connect()
_, iq_event = q.expect_many(
- EventPattern('dbus-signal', signal='StatusChanged', args=[0, 1]),
+ EventPattern('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED]),
EventPattern('stream-iq', to=None, query_ns='vcard-temp',
query_name='vCard'))
diff --git a/tests/twisted/tubes/offer-muc-stream-tube.py b/tests/twisted/tubes/offer-muc-stream-tube.py
index 321f381..271d299 100644
--- a/tests/twisted/tubes/offer-muc-stream-tube.py
+++ b/tests/twisted/tubes/offer-muc-stream-tube.py
@@ -71,7 +71,8 @@ def test(q, bus, conn, stream, bytestream_cls,
conn.Connect()
_, iq_event = q.expect_many(
- EventPattern('dbus-signal', signal='StatusChanged', args=[0, 1]),
+ EventPattern('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED]),
EventPattern('stream-iq', to=None, query_ns='vcard-temp',
query_name='vCard'))
diff --git a/tests/twisted/tubes/offer-no-caps.py b/tests/twisted/tubes/offer-no-caps.py
index e9eb5b6..1955768 100644
--- a/tests/twisted/tubes/offer-no-caps.py
+++ b/tests/twisted/tubes/offer-no-caps.py
@@ -27,7 +27,8 @@ def test(q, bus, conn, stream):
conn.Connect()
_, vcard_event, roster_event = q.expect_many(
- EventPattern('dbus-signal', signal='StatusChanged', args=[0, 1]),
+ EventPattern('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED]),
EventPattern('stream-iq', to=None, query_ns='vcard-temp',
query_name='vCard'),
EventPattern('stream-iq', query_ns=ns.ROSTER))
diff --git a/tests/twisted/tubes/offer-private-dbus-tube.py b/tests/twisted/tubes/offer-private-dbus-tube.py
index 5756cd5..9062fe4 100644
--- a/tests/twisted/tubes/offer-private-dbus-tube.py
+++ b/tests/twisted/tubes/offer-private-dbus-tube.py
@@ -280,7 +280,8 @@ def test(q, bus, conn, stream, bytestream_cls, access_control):
conn.Connect()
_, disco_event = q.expect_many(
- EventPattern('dbus-signal', signal='StatusChanged', args=[0, 1]),
+ EventPattern('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED]),
EventPattern('stream-iq', to='localhost', query_ns=ns.DISCO_ITEMS))
announce_socks5_proxy(q, stream, disco_event.stanza)
diff --git a/tests/twisted/tubes/offer-private-stream-tube.py b/tests/twisted/tubes/offer-private-stream-tube.py
index 35852f4..a11117a 100644
--- a/tests/twisted/tubes/offer-private-stream-tube.py
+++ b/tests/twisted/tubes/offer-private-stream-tube.py
@@ -49,7 +49,8 @@ def test(q, bus, conn, stream, bytestream_cls,
conn.Connect()
_, vcard_event, roster_event = q.expect_many(
- EventPattern('dbus-signal', signal='StatusChanged', args=[0, 1]),
+ EventPattern('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED]),
EventPattern('stream-iq', to=None, query_ns='vcard-temp',
query_name='vCard'),
EventPattern('stream-iq', query_ns=ns.ROSTER))
diff --git a/tests/twisted/tubes/request-invalid-dbus-tube.py b/tests/twisted/tubes/request-invalid-dbus-tube.py
index 599bddd..09907c0 100644
--- a/tests/twisted/tubes/request-invalid-dbus-tube.py
+++ b/tests/twisted/tubes/request-invalid-dbus-tube.py
@@ -12,7 +12,8 @@ invalid_service_names = [ 'invalidServiceName'
def test(q, bus, conn, stream):
conn.Connect()
- q.expect('dbus-signal', signal='StatusChanged', args=[0L, 1L])
+ q.expect('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED])
for invalid_service_name in invalid_service_names:
try:
diff --git a/tests/twisted/tubes/test-socks5-muc.py b/tests/twisted/tubes/test-socks5-muc.py
index e58184e..79a236a 100644
--- a/tests/twisted/tubes/test-socks5-muc.py
+++ b/tests/twisted/tubes/test-socks5-muc.py
@@ -13,7 +13,8 @@ def test(q, bus, conn, stream):
conn.Connect()
_, iq_event, disco_event = q.expect_many(
- EventPattern('dbus-signal', signal='StatusChanged', args=[0, 1]),
+ EventPattern('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED]),
EventPattern('stream-iq', to=None, query_ns='vcard-temp',
query_name='vCard'),
EventPattern('stream-iq', to='localhost', query_ns=ns.DISCO_ITEMS))
diff --git a/tests/twisted/vcard/test-alias-empty-vcard.py b/tests/twisted/vcard/test-alias-empty-vcard.py
index 19f1569..f0e3dd8 100644
--- a/tests/twisted/vcard/test-alias-empty-vcard.py
+++ b/tests/twisted/vcard/test-alias-empty-vcard.py
@@ -6,11 +6,13 @@ RequesAliases fail to return.
from servicetest import call_async, EventPattern
from gabbletest import exec_test, make_result_iq, acknowledge_iq
+import constants as cs
def test(q, bus, conn, stream):
conn.Connect()
_, event = q.expect_many(
- EventPattern('dbus-signal', signal='StatusChanged', args=[0, 1]),
+ EventPattern('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED]),
EventPattern('stream-iq', to=None, query_ns='vcard-temp',
query_name='vCard'))
diff --git a/tests/twisted/vcard/test-alias.py b/tests/twisted/vcard/test-alias.py
index 156ccc0..b152083 100644
--- a/tests/twisted/vcard/test-alias.py
+++ b/tests/twisted/vcard/test-alias.py
@@ -5,11 +5,13 @@ Test alias support.
from servicetest import call_async, EventPattern
from gabbletest import exec_test, make_result_iq, acknowledge_iq
+import constants as cs
def test(q, bus, conn, stream):
conn.Connect()
_, event = q.expect_many(
- EventPattern('dbus-signal', signal='StatusChanged', args=[0, 1]),
+ EventPattern('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED]),
EventPattern('stream-iq', to=None, query_ns='vcard-temp',
query_name='vCard'))
diff --git a/tests/twisted/vcard/test-avatar-async.py b/tests/twisted/vcard/test-avatar-async.py
index f0d2e97..2794da6 100644
--- a/tests/twisted/vcard/test-avatar-async.py
+++ b/tests/twisted/vcard/test-avatar-async.py
@@ -8,11 +8,13 @@ import hashlib
from servicetest import EventPattern
from gabbletest import exec_test, acknowledge_iq, make_result_iq
+import constants as cs
def test(q, bus, conn, stream):
conn.Connect()
_, iq_event = q.expect_many(
- EventPattern('dbus-signal', signal='StatusChanged', args=[0, 1]),
+ EventPattern('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED]),
EventPattern('stream-iq', to=None, query_ns='vcard-temp',
query_name='vCard'))
diff --git a/tests/twisted/vcard/test-avatar-retrieved.py b/tests/twisted/vcard/test-avatar-retrieved.py
index fd9ef4a..b48197b 100644
--- a/tests/twisted/vcard/test-avatar-retrieved.py
+++ b/tests/twisted/vcard/test-avatar-retrieved.py
@@ -8,11 +8,13 @@ import base64
from servicetest import EventPattern
from gabbletest import exec_test, acknowledge_iq, make_result_iq
+import constants as cs
def test(q, bus, conn, stream):
conn.Connect()
_, iq_event = q.expect_many(
- EventPattern('dbus-signal', signal='StatusChanged', args=[0, 1]),
+ EventPattern('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED]),
EventPattern('stream-iq', to=None, query_ns='vcard-temp',
query_name='vCard'))
diff --git a/tests/twisted/vcard/test-avatar-tokens.py b/tests/twisted/vcard/test-avatar-tokens.py
index f461773..fc18901 100644
--- a/tests/twisted/vcard/test-avatar-tokens.py
+++ b/tests/twisted/vcard/test-avatar-tokens.py
@@ -8,6 +8,7 @@ from twisted.words.xish import domish
from servicetest import unwrap, EventPattern
from gabbletest import exec_test, make_result_iq
import ns
+import constants as cs
def make_presence(jid, sha1sum):
p = domish.Element((None, 'presence'))
@@ -20,7 +21,8 @@ def make_presence(jid, sha1sum):
def test(q, bus, conn, stream):
conn.Connect()
_, event = q.expect_many(
- EventPattern('dbus-signal', signal='StatusChanged', args=[0, 1]),
+ EventPattern('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED]),
EventPattern('stream-iq', to=None, query_ns=ns.ROSTER,
query_name='query'))
diff --git a/tests/twisted/vcard/test-avatar.py b/tests/twisted/vcard/test-avatar.py
index 576d647..52975dc 100644
--- a/tests/twisted/vcard/test-avatar.py
+++ b/tests/twisted/vcard/test-avatar.py
@@ -7,11 +7,13 @@ import base64
from servicetest import call_async, EventPattern
from gabbletest import exec_test, acknowledge_iq, make_result_iq
+import constants as cs
def test(q, bus, conn, stream):
conn.Connect()
_, event = q.expect_many(
- EventPattern('dbus-signal', signal='StatusChanged', args=[0, 1]),
+ EventPattern('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED]),
EventPattern('stream-iq', to=None, query_ns='vcard-temp',
query_name='vCard'))
diff --git a/tests/twisted/vcard/test-set-alias.py b/tests/twisted/vcard/test-set-alias.py
index 28dc0be..af1e252 100644
--- a/tests/twisted/vcard/test-set-alias.py
+++ b/tests/twisted/vcard/test-set-alias.py
@@ -5,11 +5,13 @@ Test alias setting support.
from servicetest import EventPattern
from gabbletest import exec_test, acknowledge_iq
+import constants as cs
def test(q, bus, conn, stream):
conn.Connect()
_, iq_event = q.expect_many(
- EventPattern('dbus-signal', signal='StatusChanged', args=[0, 1]),
+ EventPattern('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED]),
EventPattern('stream-iq', to=None, query_ns='vcard-temp',
query_name='vCard'))
diff --git a/tests/twisted/vcard/test-vcard-cache.py b/tests/twisted/vcard/test-vcard-cache.py
index d396409..71dd1d8 100644
--- a/tests/twisted/vcard/test-vcard-cache.py
+++ b/tests/twisted/vcard/test-vcard-cache.py
@@ -10,7 +10,8 @@ import constants as cs
def test(q, bus, conn, stream):
conn.Connect()
_, event = q.expect_many(
- EventPattern('dbus-signal', signal='StatusChanged', args=[0, 1]),
+ EventPattern('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED]),
EventPattern('stream-iq', to=None, query_ns='vcard-temp',
query_name='vCard'))
--
1.5.6.5
More information about the telepathy-commits
mailing list