~ubuntu-branches/ubuntu/trusty/telepathy-idle/trusty

« back to all changes in this revision

Viewing changes to tests/twisted/connect/disconnect-during-cert-verification.py

  • Committer: Package Import Robot
  • Author(s): Simon McVittie
  • Date: 2013-05-01 15:52:26 UTC
  • mfrom: (1.3.6)
  • Revision ID: package-import@ubuntu.com-20130501155226-ttpmql3jetet34iu
Tags: 0.1.16-1
* New upstream release
  - adds support for interactive TLS certificate verification
    (Closes: #706270)
* Add a patch to avoid use of a telepathy-glib 0.20 header, to make
  this easy to backport to wheezy

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
"""
 
2
Test disconnecting while a certificate verification channel is open.
 
3
"""
 
4
 
 
5
import dbus
 
6
import constants as cs
 
7
from idletest import exec_test, SSLIRCServer
 
8
from servicetest import EventPattern, sync_dbus
 
9
 
 
10
def test(q, bus, conn, stream):
 
11
    conn.Connect()
 
12
    q.expect_many(
 
13
            EventPattern('dbus-signal', signal='StatusChanged', args=[1, 1]),
 
14
            EventPattern('irc-connected'))
 
15
    e = q.expect('dbus-signal', signal='NewChannels')
 
16
 
 
17
    conn.Disconnect()
 
18
    q.expect_many(
 
19
            EventPattern('dbus-signal', signal='StatusChanged'),
 
20
            EventPattern('irc-disconnected'),
 
21
            )
 
22
 
 
23
    # Idle would now crash in an idle callback; so let's see if it's alive.
 
24
    sync_dbus(bus, q, conn)
 
25
 
 
26
if __name__ == '__main__':
 
27
    exec_test(test, {'use-ssl':dbus.Boolean(True)}, protocol=SSLIRCServer)
 
28