~ubuntu-branches/ubuntu/precise/telepathy-mission-control-5/precise

« back to all changes in this revision

Viewing changes to test/twisted/account-manager/presence.py

Tags: upstream-5.5.2
ImportĀ upstreamĀ versionĀ 5.5.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
95
95
    call_async(q, account_props, 'Set', cs.ACCOUNT, 'RequestedPresence',
96
96
            presence)
97
97
 
98
 
    e = q.expect('dbus-method-call',
99
 
        interface=cs.CONN_IFACE_SIMPLE_PRESENCE, method='SetPresence',
100
 
        args=list(presence[1:]),
101
 
        handled=True)
102
 
 
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:]),
 
102
            handled=True),
 
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))
106
111
 
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