diff options
Diffstat (limited to 'tests/twisted/account-manager/reconnect.py')
-rw-r--r-- | tests/twisted/account-manager/reconnect.py | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/tests/twisted/account-manager/reconnect.py b/tests/twisted/account-manager/reconnect.py index 44af4100..39624a9c 100644 --- a/tests/twisted/account-manager/reconnect.py +++ b/tests/twisted/account-manager/reconnect.py @@ -27,13 +27,10 @@ from mctest import exec_test, SimulatedConnection, create_fakecm_account,\ import constants as cs def test(q, bus, mc): - cm_name_ref = dbus.service.BusName( - tp_name_prefix + '.ConnectionManager.fakecm', bus=bus) - # Create an account params = dbus.Dictionary({"account": "someguy@example.com", "password": "secrecy"}, signature='sv') - (cm_name_ref, account) = create_fakecm_account(q, bus, mc, params) + (simulated_cm, account) = create_fakecm_account(q, bus, mc, params) # Events that indicate that Reconnect might have done something looks_like_reconnection = [ @@ -51,7 +48,7 @@ def test(q, bus, mc): dbus_interface=cs.PROPERTIES_IFACE) q.expect('dbus-return', method='Set') - requested_presence = dbus.Struct((dbus.UInt32(cs.PRESENCE_TYPE_AVAILABLE), + requested_presence = dbus.Struct((dbus.UInt32(cs.PRESENCE_AVAILABLE), dbus.String(u'available'), dbus.String(u''))) call_async(q, account, 'Set', cs.ACCOUNT, 'RequestedPresence', requested_presence, @@ -65,7 +62,7 @@ def test(q, bus, mc): # While we want to be offline but the account is enabled, Reconnect is # still a no-op. - requested_presence = dbus.Struct((dbus.UInt32(cs.PRESENCE_TYPE_OFFLINE), + requested_presence = dbus.Struct((dbus.UInt32(cs.PRESENCE_OFFLINE), dbus.String(u'offline'), dbus.String(u''))) call_async(q, account, 'Set', cs.ACCOUNT, 'RequestedPresence', requested_presence, @@ -98,7 +95,7 @@ def test(q, bus, mc): q.unforbid_events(looks_like_reconnection) - requested_presence = dbus.Struct((dbus.UInt32(cs.PRESENCE_TYPE_AVAILABLE), + requested_presence = dbus.Struct((dbus.UInt32(cs.PRESENCE_AVAILABLE), dbus.String(u'brb'), dbus.String(u'Be back soon!'))) account.Set(cs.ACCOUNT, 'RequestedPresence', requested_presence, @@ -125,13 +122,13 @@ def test(q, bus, mc): path=conn.object_path, handled=True), ) - # MC calls GetStatus (maybe) and then Connect - + # MC prepares the connection, does any pre-Connect setup, then + # calls Connect q.expect('dbus-method-call', method='Connect', path=conn.object_path, handled=True) # Connect succeeds - conn.StatusChanged(cs.CONN_STATUS_CONNECTED, cs.CONN_STATUS_REASON_NONE) + conn.StatusChanged(cs.CONN_STATUS_CONNECTED, cs.CSR_NONE_SPECIFIED) # Assert that the NormalizedName is harvested from the Connection at some # point @@ -180,10 +177,10 @@ def test(q, bus, mc): q.expect('dbus-method-call', method='Connect', path=conn.object_path, handled=True) - conn.StatusChanged(cs.CONN_STATUS_CONNECTED, cs.CONN_STATUS_REASON_NONE) + conn.StatusChanged(cs.CONN_STATUS_CONNECTED, cs.CSR_NONE_SPECIFIED) # Put the account offline - requested_presence = (dbus.UInt32(cs.PRESENCE_TYPE_OFFLINE), 'offline', '') + requested_presence = (dbus.UInt32(cs.PRESENCE_OFFLINE), 'offline', '') account.Set(cs.ACCOUNT, 'RequestedPresence', requested_presence, dbus_interface=cs.PROPERTIES_IFACE) |