95
95
call_async(q, account_props, 'Set', cs.ACCOUNT, 'RequestedPresence',
98
e = q.expect('dbus-method-call',
99
interface=cs.CONN_IFACE_SIMPLE_PRESENCE, method='SetPresence',
100
args=list(presence[1:]),
103
q.expect('dbus-signal', path=account.object_path,
104
interface=cs.ACCOUNT, signal='AccountPropertyChanged',
105
predicate=lambda e: e.args[0].get('CurrentPresence') == presence)
98
e, _, _ = q.expect_many(
99
EventPattern('dbus-method-call',
100
interface=cs.CONN_IFACE_SIMPLE_PRESENCE, method='SetPresence',
101
args=list(presence[1:]),
103
EventPattern('dbus-signal', path=account.object_path,
104
interface=cs.ACCOUNT, signal='AccountPropertyChanged',
105
predicate=lambda e: e.args[0].get('ChangingPresence') == True and
106
e.args[0].get('RequestedPresence') == presence),
107
EventPattern('dbus-signal', path=account.object_path,
108
interface=cs.ACCOUNT, signal='AccountPropertyChanged',
109
predicate=lambda e: e.args[0].get('CurrentPresence') == presence and
110
e.args[0].get('ChangingPresence') == False))
107
112
# Setting RequestedPresence=RequestedPresence causes a (possibly redundant)
108
113
# call to the CM, so we get any side-effects there might be, either in the