#NEWLINE# def test_deleteNotificationWithRedirect( self ) : #NEWLINE# #INDENT# redirectURI = ( 'xmpp:%s?node=test' % component ) #NEWLINE# def onNotification( data , headers ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# self . assertTrue ( headers . hasHeader ( 'Event' ) ) #NEWLINE# self . assertEquals ( [ 'DELETED' ] , headers . getRawHeaders ( 'Event' ) ) #NEWLINE# self . assertEquals ( [ ( '<%s>; rel=alternate' % redirectURI ) ] , headers . getRawHeaders ( 'Link' ) ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# self . client . deferred . errback ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . client . deferred . callback ( None ) #NEWLINE# #UNINDENT# #UNINDENT# def cb( response ) : #NEWLINE# #INDENT# xmppURI = response [ 'uri' ] #NEWLINE# d = self . client . subscribe ( xmppURI ) #NEWLINE# d . addCallback ( ( lambda _ : xmppURI ) ) #NEWLINE# return d #NEWLINE# #UNINDENT# def cb2( xmppURI ) : #NEWLINE# #INDENT# d = self . client . delete ( xmppURI , redirectURI ) #NEWLINE# return d #NEWLINE# #UNINDENT# self . client . callback = self #NEWLINE# self . client . deferred = defer . Deferred ( ) #NEWLINE# d = self . client . create ( ) #NEWLINE# d . addCallback ( cb ) #NEWLINE# d . addCallback ( cb2 ) #NEWLINE# return defer . gatherResults ( [ d , self . client . deferred ] )