summaryrefslogtreecommitdiff
path: root/tests/twisted/irc-command.py
blob: f27dbb111ffe86a81723716055512e19d6169f90 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
"""
Test Messages interface implementation
"""

from idletest import exec_test
from servicetest import call_async
import constants as cs
import dbus

def test(q, bus, conn, stream):
    conn.Connect()
    q.expect('dbus-signal', signal='StatusChanged',
        args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED])

    irc_cmd = dbus.Interface(conn, cs.CONN + '.Interface.IRCCommand1')

    call_async(q, irc_cmd, 'Send', 'badger mushroom snake')

    q.expect('stream-BADGER', data=['mushroom', 'snake'])

    q.expect('dbus-return', method='Send')

    call_async(q, conn, 'Disconnect')

if __name__ == '__main__':
    exec_test(test)