summaryrefslogtreecommitdiff
path: root/tests/twisted/account-manager/recover-from-disconnect.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/twisted/account-manager/recover-from-disconnect.py')
-rw-r--r--tests/twisted/account-manager/recover-from-disconnect.py26
1 files changed, 13 insertions, 13 deletions
diff --git a/tests/twisted/account-manager/recover-from-disconnect.py b/tests/twisted/account-manager/recover-from-disconnect.py
index 5cfe8686..932b4700 100644
--- a/tests/twisted/account-manager/recover-from-disconnect.py
+++ b/tests/twisted/account-manager/recover-from-disconnect.py
@@ -29,7 +29,7 @@ def test(q, bus, mc):
params = dbus.Dictionary({"account": "someguy@example.com",
"password": "secrecy",
"register": True}, signature='sv')
- (cm_name_ref, account) = create_fakecm_account(q, bus, mc, params)
+ (simulated_cm, account) = create_fakecm_account(q, bus, mc, params)
call_async(q, account.Properties, 'Set', cs.ACCOUNT, 'Enabled', False)
q.expect('dbus-return', method='Set')
@@ -38,7 +38,7 @@ def test(q, bus, mc):
call_async(q, account.Properties, 'Set', cs.ACCOUNT, 'Enabled', True)
# Set online presence
- presence = dbus.Struct((dbus.UInt32(cs.PRESENCE_TYPE_BUSY), 'busy',
+ presence = dbus.Struct((dbus.UInt32(cs.PRESENCE_BUSY), 'busy',
'Fixing MC bugs'), signature='uss')
call_async(q, account.Properties, 'Set', cs.ACCOUNT,
'RequestedPresence', presence)
@@ -55,13 +55,13 @@ def test(q, bus, mc):
q.dbus_return(e.message, conn.bus_name, conn.object_path, signature='so')
- # 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)
q.expect('dbus-method-call',
interface=cs.CONN_IFACE_SIMPLE_PRESENCE,
@@ -73,7 +73,7 @@ def test(q, bus, mc):
conn.ConnectionError('com.example.My.Network.Is.Full.Of.Eels',
{'eels': 23, 'capacity': 23, 'debug-message': 'Too many eels'})
conn.StatusChanged(cs.CONN_STATUS_DISCONNECTED,
- cs.CONN_STATUS_REASON_NETWORK_ERROR)
+ cs.CSR_NETWORK_ERROR)
# MC reconnects. This time, we expect it to have deleted the 'register'
# parameter.
@@ -106,7 +106,7 @@ def test(q, bus, mc):
disconnected.args[0].get('ConnectionErrorDetails'))
assertEquals(cs.CONN_STATUS_DISCONNECTED,
disconnected.args[0].get('ConnectionStatus'))
- assertEquals(cs.CONN_STATUS_REASON_NETWORK_ERROR,
+ assertEquals(cs.CSR_NETWORK_ERROR,
disconnected.args[0].get('ConnectionStatusReason'))
assertEquals('/', connecting.args[0].get('Connection'))
@@ -117,7 +117,7 @@ def test(q, bus, mc):
connecting.args[0].get('ConnectionErrorDetails'))
assertEquals(cs.CONN_STATUS_CONNECTING,
connecting.args[0].get('ConnectionStatus'))
- assertEquals(cs.CONN_STATUS_REASON_REQUESTED,
+ assertEquals(cs.CSR_REQUESTED,
connecting.args[0].get('ConnectionStatusReason'))
# The object path needs to be different from the first simulated
@@ -130,8 +130,8 @@ def test(q, bus, mc):
q.dbus_return(e.message, conn.bus_name, conn.object_path, signature='so')
- # MC calls GetStatus (maybe) and then Connect
-
+ # MC prepares the connection, does any pre-Connect setup, then
+ # calls Connect
connecting, _ = q.expect_many(
EventPattern('dbus-signal', signal='AccountPropertyChanged',
predicate=(lambda e:
@@ -150,7 +150,7 @@ def test(q, bus, mc):
connecting.args[0].get('ConnectionErrorDetails'))
assertEquals(cs.CONN_STATUS_CONNECTING,
connecting.args[0].get('ConnectionStatus'))
- assertEquals(cs.CONN_STATUS_REASON_REQUESTED,
+ assertEquals(cs.CSR_REQUESTED,
connecting.args[0].get('ConnectionStatusReason'))
assertEquals('com.example.My.Network.Is.Full.Of.Eels',
@@ -160,7 +160,7 @@ def test(q, bus, mc):
account.Properties.Get(cs.ACCOUNT, 'ConnectionErrorDetails'))
# Connect succeeds
- conn.StatusChanged(cs.CONN_STATUS_CONNECTED, cs.CONN_STATUS_REASON_NONE)
+ conn.StatusChanged(cs.CONN_STATUS_CONNECTED, cs.CSR_NONE_SPECIFIED)
connected, _ = q.expect_many(
EventPattern('dbus-signal', signal='AccountPropertyChanged',
@@ -180,7 +180,7 @@ def test(q, bus, mc):
assertEquals({}, connected.args[0].get('ConnectionErrorDetails'))
assertEquals(cs.CONN_STATUS_CONNECTED,
connected.args[0].get('ConnectionStatus'))
- assertEquals(cs.CONN_STATUS_REASON_REQUESTED,
+ assertEquals(cs.CSR_REQUESTED,
connected.args[0].get('ConnectionStatusReason'))
assertEquals('', account.Properties.Get(cs.ACCOUNT, 'ConnectionError'))