diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2013-10-09 15:28:33 -0400 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2013-10-16 11:51:39 -0400 |
commit | 5a07d1c62664c4c0a9768adc9988aabf512dc264 (patch) | |
tree | 1ad86660b2a680feb1efebefda45145ce511666c | |
parent | 8412919646ca195008ba7611386c27fe663e69d6 (diff) |
SimplePresence has been merged into Presence
-rw-r--r-- | tests/twisted/muc/test-muc-invitation.py | 4 | ||||
-rw-r--r-- | tests/twisted/muc/test-muc.py | 2 | ||||
-rw-r--r-- | tests/twisted/presence/initial-presence.py | 4 | ||||
-rw-r--r-- | tests/twisted/presence/invisible_xep_0126.py | 44 | ||||
-rw-r--r-- | tests/twisted/presence/invisible_xep_0186.py | 24 | ||||
-rw-r--r-- | tests/twisted/presence/plugins.py | 12 | ||||
-rw-r--r-- | tests/twisted/presence/presence.py | 6 | ||||
-rw-r--r-- | tests/twisted/presence/set-idempotence.py | 24 | ||||
-rw-r--r-- | tests/twisted/presence/shared-status.py | 20 | ||||
-rw-r--r-- | tests/twisted/presence_helper.py | 2 | ||||
-rw-r--r-- | tests/twisted/text/receipts.py | 2 |
11 files changed, 72 insertions, 72 deletions
diff --git a/tests/twisted/muc/test-muc-invitation.py b/tests/twisted/muc/test-muc-invitation.py index 6cc8efc44..68b03d8b9 100644 --- a/tests/twisted/muc/test-muc-invitation.py +++ b/tests/twisted/muc/test-muc-invitation.py @@ -54,8 +54,8 @@ def test(q, bus, conn, stream): # set ourselves to away and back again, to check that we don't send any # presence to the MUC before the invite has been accepted - conn.SimplePresence.SetPresence('away', 'failure') - conn.SimplePresence.SetPresence('available', 'success') + conn.Presence.SetPresence('away', 'failure') + conn.Presence.SetPresence('available', 'success') # accept the invitation call_async(q, text_chan.Group, 'AddMembers', [room_self_handle], 'Oh, OK then') diff --git a/tests/twisted/muc/test-muc.py b/tests/twisted/muc/test-muc.py index 8daedb251..85a46d9ce 100644 --- a/tests/twisted/muc/test-muc.py +++ b/tests/twisted/muc/test-muc.py @@ -207,7 +207,7 @@ def test(q, bus, conn, stream): # test that presence changes are sent via the MUC - conn.SimplePresence.SetPresence('away', 'hurrah') + conn.Presence.SetPresence('away', 'hurrah') event = q.expect('stream-presence', to='chat@conf.localhost/test') elem = event.stanza diff --git a/tests/twisted/presence/initial-presence.py b/tests/twisted/presence/initial-presence.py index 2164e5938..cef644653 100644 --- a/tests/twisted/presence/initial-presence.py +++ b/tests/twisted/presence/initial-presence.py @@ -13,9 +13,9 @@ from invisible_helper import ValidInvisibleListStream, Xep0186Stream, \ Xep0186AndValidInvisibleListStream def test(q, bus, conn, stream): - props = conn.Properties.GetAll(cs.CONN_IFACE_SIMPLE_PRESENCE) + props = conn.Properties.GetAll(cs.CONN_IFACE_PRESENCE) assertNotEquals({}, props['Statuses']) - conn.SimplePresence.SetPresence("away", "watching bees") + conn.Presence.SetPresence("away", "watching bees") conn.Connect() _, presence = q.expect_many( diff --git a/tests/twisted/presence/invisible_xep_0126.py b/tests/twisted/presence/invisible_xep_0126.py index 7dbfb36b7..b57b3c860 100644 --- a/tests/twisted/presence/invisible_xep_0126.py +++ b/tests/twisted/presence/invisible_xep_0126.py @@ -21,7 +21,7 @@ from invisible_helper import ManualPrivacyListStream from functools import partial def test_create_invisible_list(q, bus, conn, stream): - conn.SimplePresence.SetPresence("away", "") + conn.Presence.SetPresence("away", "") conn.Connect() @@ -47,10 +47,10 @@ def test_create_invisible_list(q, bus, conn, stream): args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED]) assertContains("hidden", - conn.Properties.Get(cs.CONN_IFACE_SIMPLE_PRESENCE, "Statuses")) + conn.Properties.Get(cs.CONN_IFACE_PRESENCE, "Statuses")) def test_create_invisible_list_failed(q, bus, conn, stream): - conn.SimplePresence.SetPresence("away", "") + conn.Presence.SetPresence("away", "") conn.Connect() @@ -76,17 +76,17 @@ def test_create_invisible_list_failed(q, bus, conn, stream): args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED]) assertDoesNotContain("hidden", - conn.Properties.Get(cs.CONN_IFACE_SIMPLE_PRESENCE, "Statuses")) + conn.Properties.Get(cs.CONN_IFACE_PRESENCE, "Statuses")) def test_invisible_on_connect_fail_no_list(q, bus, conn, stream): - props = conn.Properties.GetAll(cs.CONN_IFACE_SIMPLE_PRESENCE) + props = conn.Properties.GetAll(cs.CONN_IFACE_PRESENCE) assertNotEquals({}, props['Statuses']) presence_event_pattern = EventPattern('stream-presence') q.forbid_events([presence_event_pattern]) - conn.SimplePresence.SetPresence("hidden", "") + conn.Presence.SetPresence("hidden", "") conn.Connect() @@ -103,25 +103,25 @@ def test_invisible_on_connect_fail_no_list(q, bus, conn, stream): # Darn! At least we should have our presence set to DND. q.expect_many( EventPattern('dbus-signal', signal='PresencesChanged', - interface=cs.CONN_IFACE_SIMPLE_PRESENCE, + interface=cs.CONN_IFACE_PRESENCE, args=[{1: (6, 'dnd', '')}]), EventPattern('dbus-signal', signal='StatusChanged', args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED])) # 'hidden' should not be an available status. assertDoesNotContain("hidden", - conn.Properties.Get(cs.CONN_IFACE_SIMPLE_PRESENCE, "Statuses")) + conn.Properties.Get(cs.CONN_IFACE_PRESENCE, "Statuses")) def test_invisible_on_connect_fail_invalid_list(q, bus, conn, stream, really_invalid=False): - props = conn.Properties.GetAll(cs.CONN_IFACE_SIMPLE_PRESENCE) + props = conn.Properties.GetAll(cs.CONN_IFACE_PRESENCE) assertNotEquals({}, props['Statuses']) presence_event_pattern = EventPattern('stream-presence') q.forbid_events([presence_event_pattern]) - conn.SimplePresence.SetPresence("hidden", "") + conn.Presence.SetPresence("hidden", "") conn.Connect() @@ -155,24 +155,24 @@ def test_invisible_on_connect_fail_invalid_list(q, bus, conn, stream, q.expect_many( EventPattern('dbus-signal', signal='PresencesChanged', - interface=cs.CONN_IFACE_SIMPLE_PRESENCE, + interface=cs.CONN_IFACE_PRESENCE, args=[{1: (5, 'hidden', '')}]), EventPattern('dbus-signal', signal='StatusChanged', args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED])) # 'hidden' should not be an available status. assertContains("hidden", - conn.Properties.Get(cs.CONN_IFACE_SIMPLE_PRESENCE, "Statuses")) + conn.Properties.Get(cs.CONN_IFACE_PRESENCE, "Statuses")) def test_invisible_on_connect_fail(q, bus, conn, stream): - props = conn.Properties.GetAll(cs.CONN_IFACE_SIMPLE_PRESENCE) + props = conn.Properties.GetAll(cs.CONN_IFACE_PRESENCE) assertNotEquals({}, props['Statuses']) presence_event_pattern = EventPattern('stream-presence') q.forbid_events([presence_event_pattern]) - conn.SimplePresence.SetPresence("hidden", "") + conn.Presence.SetPresence("hidden", "") conn.Connect() @@ -194,20 +194,20 @@ def test_invisible_on_connect_fail(q, bus, conn, stream): # Darn! At least we should have our presence set to DND. q.expect_many( EventPattern('dbus-signal', signal='PresencesChanged', - interface=cs.CONN_IFACE_SIMPLE_PRESENCE, + interface=cs.CONN_IFACE_PRESENCE, args=[{1: (6, 'dnd', '')}]), EventPattern('dbus-signal', signal='StatusChanged', args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED])) def test_invisible_on_connect(q, bus, conn, stream): - props = conn.Properties.GetAll(cs.CONN_IFACE_SIMPLE_PRESENCE) + props = conn.Properties.GetAll(cs.CONN_IFACE_PRESENCE) assertNotEquals({}, props['Statuses']) presence_event_pattern = EventPattern('stream-presence') q.forbid_events([presence_event_pattern]) - conn.SimplePresence.SetPresence("hidden", "") + conn.Presence.SetPresence("hidden", "") conn.Connect() @@ -244,9 +244,9 @@ def test_invisible(q, bus, conn, stream): args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED]) assertContains("hidden", - conn.Properties.Get(cs.CONN_IFACE_SIMPLE_PRESENCE, "Statuses")) + conn.Properties.Get(cs.CONN_IFACE_PRESENCE, "Statuses")) - conn.SimplePresence.SetPresence("hidden", "") + conn.Presence.SetPresence("hidden", "") # §3.5 Become Globally Invisible # <http://xmpp.org/extensions/xep-0126.html#invis-global> @@ -268,10 +268,10 @@ def test_invisible(q, bus, conn, stream): q.expect_many( EventPattern('stream-presence', to=None, presence_type=None), EventPattern('dbus-signal', signal='PresencesChanged', - interface=cs.CONN_IFACE_SIMPLE_PRESENCE, + interface=cs.CONN_IFACE_PRESENCE, args=[{1: (5, 'hidden', '')}])) - conn.SimplePresence.SetPresence("away", "gone") + conn.Presence.SetPresence("away", "gone") # §3.3 Become Globally Visible @@ -293,7 +293,7 @@ def test_invisible(q, bus, conn, stream): q.expect_many( EventPattern('stream-presence', to=None, presence_type=None), EventPattern('dbus-signal', signal='PresencesChanged', - interface=cs.CONN_IFACE_SIMPLE_PRESENCE, + interface=cs.CONN_IFACE_PRESENCE, args=[{1: (3, 'away', 'gone')}])) def test_privacy_list_push_conflict(q, bus, conn, stream): diff --git a/tests/twisted/presence/invisible_xep_0186.py b/tests/twisted/presence/invisible_xep_0186.py index a70de53e7..5b6797104 100644 --- a/tests/twisted/presence/invisible_xep_0186.py +++ b/tests/twisted/presence/invisible_xep_0186.py @@ -12,14 +12,14 @@ import constants as cs from invisible_helper import Xep0186AndValidInvisibleListStream, Xep0186Stream def test_invisible_on_connect(q, bus, conn, stream): - props = conn.Properties.GetAll(cs.CONN_IFACE_SIMPLE_PRESENCE) + props = conn.Properties.GetAll(cs.CONN_IFACE_PRESENCE) assertNotEquals({}, props['Statuses']) presence_event_pattern = EventPattern('stream-presence') q.forbid_events([presence_event_pattern]) - conn.SimplePresence.SetPresence("hidden", "") + conn.Presence.SetPresence("hidden", "") conn.Connect() @@ -32,7 +32,7 @@ def test_invisible_on_connect(q, bus, conn, stream): args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED]) def test_invisible_on_connect_fails(q, bus, conn, stream): - conn.SimplePresence.SetPresence("hidden", "") + conn.Presence.SetPresence("hidden", "") conn.Connect() event = q.expect('stream-iq', query_name='invisible') @@ -41,16 +41,16 @@ def test_invisible_on_connect_fails(q, bus, conn, stream): # Darn! At least we should have our presence set to DND. q.expect_many( EventPattern('dbus-signal', signal='PresencesChanged', - interface=cs.CONN_IFACE_SIMPLE_PRESENCE, + interface=cs.CONN_IFACE_PRESENCE, args=[{1: (6, 'dnd', '')}]), EventPattern('dbus-signal', signal='StatusChanged', args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED])) def test_invisible(q, bus, conn, stream): assertContains("hidden", - conn.Properties.Get(cs.CONN_IFACE_SIMPLE_PRESENCE, "Statuses")) + conn.Properties.Get(cs.CONN_IFACE_PRESENCE, "Statuses")) - conn.SimplePresence.SetPresence("hidden", "") + conn.Presence.SetPresence("hidden", "") # First we send an <invisible/> command. event = q.expect('stream-iq', query_name='invisible') @@ -58,10 +58,10 @@ def test_invisible(q, bus, conn, stream): # When that's returned successfully, we can signal the change on D-Bus. q.expect('dbus-signal', signal='PresencesChanged', - interface=cs.CONN_IFACE_SIMPLE_PRESENCE, + interface=cs.CONN_IFACE_PRESENCE, args=[{1: (5, 'hidden', '')}]) - conn.SimplePresence.SetPresence("away", "gone") + conn.Presence.SetPresence("away", "gone") # First Gabble sends a <visible/> command. event = q.expect('stream-iq', query_name='visible') @@ -73,14 +73,14 @@ def test_invisible(q, bus, conn, stream): q.expect_many( EventPattern('stream-presence', to=None), EventPattern('dbus-signal', signal='PresencesChanged', - interface=cs.CONN_IFACE_SIMPLE_PRESENCE, + interface=cs.CONN_IFACE_PRESENCE, args=[{1: (3, 'away', 'gone')}])) def test_invisible_fails(q, bus, conn, stream): assertContains("hidden", - conn.Properties.Get(cs.CONN_IFACE_SIMPLE_PRESENCE, "Statuses")) + conn.Properties.Get(cs.CONN_IFACE_PRESENCE, "Statuses")) - conn.SimplePresence.SetPresence("hidden", "") + conn.Presence.SetPresence("hidden", "") # First we send an <invisible/> command. event = q.expect('stream-iq', query_name='invisible') @@ -88,7 +88,7 @@ def test_invisible_fails(q, bus, conn, stream): # When that fails, we should expect our status to change to dnd. q.expect('dbus-signal', signal='PresencesChanged', - interface=cs.CONN_IFACE_SIMPLE_PRESENCE, + interface=cs.CONN_IFACE_PRESENCE, args=[{1: (6, 'dnd', '')}]) diff --git a/tests/twisted/presence/plugins.py b/tests/twisted/presence/plugins.py index 67901142a..59b125b16 100644 --- a/tests/twisted/presence/plugins.py +++ b/tests/twisted/presence/plugins.py @@ -18,7 +18,7 @@ from invisible_helper import Xep0186AndManualPrivacyListStream, \ ManualPrivacyListStream def test(q, bus, conn, stream): - statuses = conn.Properties.Get(cs.CONN_IFACE_SIMPLE_PRESENCE, + statuses = conn.Properties.Get(cs.CONN_IFACE_PRESENCE, 'Statuses') # testbusy and testaway are provided by test plugin @@ -28,7 +28,7 @@ def test(q, bus, conn, stream): assertEquals(statuses['testbusy'][0], cs.PRESENCE_BUSY) assertEquals(statuses['testaway'][0], cs.PRESENCE_AWAY) - conn.SimplePresence.SetPresence('testbusy', '') + conn.Presence.SetPresence('testbusy', '') conn.Connect() @@ -69,11 +69,11 @@ def test(q, bus, conn, stream): args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED]) # ... testaway is not supposed to be settable on us - call_async(q, conn.SimplePresence, 'SetPresence', 'testaway', '') + call_async(q, conn.Presence, 'SetPresence', 'testaway', '') q.expect('dbus-error', method='SetPresence', name=cs.INVALID_ARGUMENT) def test_with_xep0186(q, bus, conn, stream): - statuses = conn.Properties.Get(cs.CONN_IFACE_SIMPLE_PRESENCE, + statuses = conn.Properties.Get(cs.CONN_IFACE_PRESENCE, 'Statuses') # testbusy and testaway are provided by test plugin @@ -83,7 +83,7 @@ def test_with_xep0186(q, bus, conn, stream): assertEquals(statuses['testbusy'][0], cs.PRESENCE_BUSY) assertEquals(statuses['testaway'][0], cs.PRESENCE_AWAY) - conn.SimplePresence.SetPresence('testbusy', '') + conn.Presence.SetPresence('testbusy', '') conn.Connect() @@ -105,7 +105,7 @@ def test_with_xep0186(q, bus, conn, stream): args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED]) # ... testaway is not supposed to be settable on us - call_async(q, conn.SimplePresence, 'SetPresence', 'testaway', '') + call_async(q, conn.Presence, 'SetPresence', 'testaway', '') q.expect('dbus-error', method='SetPresence', name=cs.INVALID_ARGUMENT) diff --git a/tests/twisted/presence/presence.py b/tests/twisted/presence/presence.py index 8d35e284a..30f8b5b59 100644 --- a/tests/twisted/presence/presence.py +++ b/tests/twisted/presence/presence.py @@ -1,5 +1,5 @@ """ -A simple smoke-test for C.I.SimplePresence +A simple smoke-test for C.I.Presence """ from twisted.words.xish import domish @@ -34,11 +34,11 @@ def test(q, bus, conn, stream): (cs.PRESENCE_AVAILABLE, 'chat', 'I may have been drinking')}]) amy_handle, asv = conn.Contacts.GetContactByID('amy@foo.com', - [cs.CONN_IFACE_SIMPLE_PRESENCE]) + [cs.CONN_IFACE_PRESENCE]) assertEquals(e.args[0][amy_handle], asv.get(cs.ATTR_PRESENCE)) bob_handle, asv = conn.Contacts.GetContactByID('bob@foo.com', - [cs.CONN_IFACE_SIMPLE_PRESENCE]) + [cs.CONN_IFACE_PRESENCE]) assertEquals((cs.PRESENCE_UNKNOWN, 'unknown', ''), asv.get(cs.ATTR_PRESENCE)) diff --git a/tests/twisted/presence/set-idempotence.py b/tests/twisted/presence/set-idempotence.py index a4b9e9fac..4148ebc68 100644 --- a/tests/twisted/presence/set-idempotence.py +++ b/tests/twisted/presence/set-idempotence.py @@ -16,14 +16,14 @@ def run_test(q, bus, conn, stream): # Set presence to away. This should cause PresencesChanged to be emitted, # and a new <presence> stanza to be sent to the server. - conn.SimplePresence.SetPresence('away', 'gone') + conn.Presence.SetPresence('away', 'gone') simple_signal, presence = q.expect_many ( EventPattern('dbus-signal', signal='PresencesChanged'), EventPattern('stream-presence')) assert simple_signal.args == [{1L: (3L, u'away', u'gone')}] - assert conn.Contacts.GetContactAttributes([1], [cs.CONN_IFACE_SIMPLE_PRESENCE]) == { 1L: - { cs.CONN_IFACE_SIMPLE_PRESENCE + "/presence": (3L, u'away', u'gone'), + assert conn.Contacts.GetContactAttributes([1], [cs.CONN_IFACE_PRESENCE]) == { 1L: + { cs.CONN_IFACE_PRESENCE + "/presence": (3L, u'away', u'gone'), cs.ATTR_CONTACT_ID: 'test@localhost'}} @@ -35,15 +35,15 @@ def run_test(q, bus, conn, stream): # Set presence a second time. Since this call is redundant, there should # be no PresencesChanged or <presence> sent to the server. - conn.SimplePresence.SetPresence('away', 'gone') - assert conn.Contacts.GetContactAttributes([1], [cs.CONN_IFACE_SIMPLE_PRESENCE]) == { 1L: - { cs.CONN_IFACE_SIMPLE_PRESENCE + "/presence": (3L, u'away', u'gone'), + conn.Presence.SetPresence('away', 'gone') + assert conn.Contacts.GetContactAttributes([1], [cs.CONN_IFACE_PRESENCE]) == { 1L: + { cs.CONN_IFACE_PRESENCE + "/presence": (3L, u'away', u'gone'), cs.ATTR_CONTACT_ID: 'test@localhost'}} # Set presence a third time. This call is not redundant, and should # generate a signal/message. - conn.SimplePresence.SetPresence('available', 'yo') + conn.Presence.SetPresence('available', 'yo') simple_signal, presence = q.expect_many ( EventPattern('dbus-signal', signal='PresencesChanged'), @@ -53,21 +53,21 @@ def run_test(q, bus, conn, stream): children = list(presence.stanza.elements()) assert children[0].name == 'status' assert str(children[0]) == 'yo' - assert conn.Contacts.GetContactAttributes([1], [cs.CONN_IFACE_SIMPLE_PRESENCE]) == { 1L: - { cs.CONN_IFACE_SIMPLE_PRESENCE + "/presence": (2L, u'available', u'yo'), + assert conn.Contacts.GetContactAttributes([1], [cs.CONN_IFACE_PRESENCE]) == { 1L: + { cs.CONN_IFACE_PRESENCE + "/presence": (2L, u'available', u'yo'), cs.ATTR_CONTACT_ID: 'test@localhost'}} # call SetPresence with an empty message, as this used to cause a # crash in tp-glib - conn.SimplePresence.SetPresence('available', '') + conn.Presence.SetPresence('available', '') simple_signal, presence = q.expect_many ( EventPattern('dbus-signal', signal='PresencesChanged'), EventPattern('stream-presence')) assert simple_signal.args == [{1L: (2L, u'available', u'')}] - assert conn.Contacts.GetContactAttributes([1], [cs.CONN_IFACE_SIMPLE_PRESENCE]) == { 1L: - { cs.CONN_IFACE_SIMPLE_PRESENCE + "/presence": (2L, u'available', u''), + assert conn.Contacts.GetContactAttributes([1], [cs.CONN_IFACE_PRESENCE]) == { 1L: + { cs.CONN_IFACE_PRESENCE + "/presence": (2L, u'available', u''), cs.ATTR_CONTACT_ID: 'test@localhost'}} diff --git a/tests/twisted/presence/shared-status.py b/tests/twisted/presence/shared-status.py index b2e02b8cc..a5783fe84 100644 --- a/tests/twisted/presence/shared-status.py +++ b/tests/twisted/presence/shared-status.py @@ -53,7 +53,7 @@ def _test_remote_status(q, bus, conn, stream, msg, show, list_attrs): def _test_remote_status_away(q, bus, conn, stream, msg, show, list_attrs): events = [EventPattern('dbus-signal', signal='PresencesChanged', - interface=cs.CONN_IFACE_SIMPLE_PRESENCE, + interface=cs.CONN_IFACE_PRESENCE, args=[{1: (presence_types[show], show, msg)}])] q.forbid_events(events) @@ -72,7 +72,7 @@ def _test_remote_status_not_away(q, stream, msg, show, list_attrs): q.expect('stream-iq', iq_type='result') q.expect('dbus-signal', signal='PresencesChanged', - interface=cs.CONN_IFACE_SIMPLE_PRESENCE, + interface=cs.CONN_IFACE_PRESENCE, args=[{1: (presence_types[show], show, msg)}]) def _test_local_status(q, conn, stream, msg, show, expected_show=None): @@ -110,7 +110,7 @@ def _test_local_status(q, conn, stream, msg, show, expected_show=None): if wrong_presence_pattern: q.forbid_events([wrong_presence_pattern]) - conn.SimplePresence.SetPresence(show, msg) + conn.Presence.SetPresence(show, msg) max_status_message_length = int(stream.max_status_message_length) @@ -133,7 +133,7 @@ def _test_local_status(q, conn, stream, msg, show, expected_show=None): q.expect('stream-presence') q.expect('dbus-signal', signal='PresencesChanged', - interface=cs.CONN_IFACE_SIMPLE_PRESENCE, + interface=cs.CONN_IFACE_PRESENCE, args=[{1: (presence_types[expected_show], expected_show, msg[:max_status_message_length])}]) @@ -211,7 +211,7 @@ def test(q, bus, conn, stream): q.expect('stream-iq', iq_type='result') q.expect('dbus-signal', signal='PresencesChanged', - interface=cs.CONN_IFACE_SIMPLE_PRESENCE, + interface=cs.CONN_IFACE_PRESENCE, args=[{1: (cs.PRESENCE_BUSY, 'dnd', "Peekabo")}]) def _test_on_connect(q, bus, conn, stream, shared_status, show, msg, @@ -227,7 +227,7 @@ def _test_on_connect(q, bus, conn, stream, shared_status, show, msg, iq_type='get')] q.forbid_events(forbidden_event_patterns) - conn.SimplePresence.SetPresence(show, msg) + conn.Presence.SetPresence(show, msg) conn.Connect() _, event = q.expect_many(EventPattern('stream-iq', query_ns=ns.GOOGLE_SHARED_STATUS, @@ -246,7 +246,7 @@ def _test_on_connect(q, bus, conn, stream, shared_status, show, msg, q.expect_many( EventPattern('dbus-signal', signal='PresencesChanged', - interface=cs.CONN_IFACE_SIMPLE_PRESENCE, + interface=cs.CONN_IFACE_PRESENCE, args=[{1: (presence_types[expected_show], expected_show, msg)}]), EventPattern('dbus-signal', signal='StatusChanged', @@ -287,7 +287,7 @@ def test_connect_hidden_not_available(q, bus, conn, stream): presence_event_pattern = EventPattern('stream-presence') q.forbid_events([presence_event_pattern]) - conn.SimplePresence.SetPresence(show, msg) + conn.Presence.SetPresence(show, msg) conn.Connect() _, event = q.expect_many(EventPattern('stream-iq', query_ns=ns.GOOGLE_SHARED_STATUS, @@ -304,7 +304,7 @@ def test_connect_hidden_not_available(q, bus, conn, stream): q.expect_many( EventPattern('dbus-signal', signal='PresencesChanged', - interface=cs.CONN_IFACE_SIMPLE_PRESENCE, + interface=cs.CONN_IFACE_PRESENCE, args=[{1: (cs.PRESENCE_BUSY, "dnd", msg)}]), EventPattern('dbus-signal', signal='StatusChanged', args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED])) @@ -362,7 +362,7 @@ def test_shared_status_chat(q, bus, conn, stream): EventPattern('stream-presence')) try: - conn.SimplePresence.SetPresence('chat', 'This is not going to work') + conn.Presence.SetPresence('chat', 'This is not going to work') except dbus.DBusException, e: assert e.get_dbus_name() == cs.NOT_AVAILABLE else: diff --git a/tests/twisted/presence_helper.py b/tests/twisted/presence_helper.py index f480c58c9..7aed6aeb3 100644 --- a/tests/twisted/presence_helper.py +++ b/tests/twisted/presence_helper.py @@ -1,7 +1,7 @@ import constants as cs def get_contacts_presences_sync(conn, contacts): - h2asv = conn.Contacts.GetContactAttributes(contacts, [cs.CONN_IFACE_SIMPLE_PRESENCE]) + h2asv = conn.Contacts.GetContactAttributes(contacts, [cs.CONN_IFACE_PRESENCE]) presences = {} for h in contacts: presences[h] = h2asv[h][cs.ATTR_PRESENCE] diff --git a/tests/twisted/text/receipts.py b/tests/twisted/text/receipts.py index 2c11af2e3..c2f9e90b9 100644 --- a/tests/twisted/text/receipts.py +++ b/tests/twisted/text/receipts.py @@ -150,7 +150,7 @@ def replying_to_requests(q, bus, conn, stream): q.unforbid_all() # If we're invisible, LeChuck shouldn't get receipts. - conn.SimplePresence.SetPresence("hidden", "") + conn.Presence.SetPresence("hidden", "") event = q.expect('stream-iq', query_name='invisible') acknowledge_iq(stream, event.stanza) |