summaryrefslogtreecommitdiff
path: root/tests/twisted/connect/connect-fail-ssl.py
blob: 283bc03a7bd76cedd34b9610a6b5b287bd81e04e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

"""
Test Network error Handling with SSL servers
"""

import dbus
from idletest import exec_test, SSLIRCServer

def test(q, bus, conn, stream):
    conn.Connect()
    q.expect('dbus-signal', signal='StatusChanged', args=[1,1]) # connecting, requested
    q.expect('dbus-signal', signal='StatusChanged', args=[2,2]) # disconnected, network-error

if __name__ == '__main__':
    # there is no ssl server listening at port 5600, so this should fail
    exec_test(test, {'port': dbus.UInt32(5600), 'use-ssl': dbus.Boolean(True)})