#NEWLINE# def test_invalid_subscribe( self ) : #NEWLINE# #INDENT# ( msg , handler , subscriber ) = self . get_subscription ( ) #NEWLINE# with pytest . raises ( InvalidSubscriber ) as exc : #NEWLINE# #INDENT# self . hub . subscribe ( None , msg , handler ) #NEWLINE# #UNINDENT# assert exc . value . args [ 0 ] . startswith ( 'Subscriber must be a HubListener' ) #NEWLINE# with pytest . raises ( InvalidMessage ) as exc : #NEWLINE# #INDENT# self . hub . subscribe ( handler , None , handler ) #NEWLINE# #UNINDENT# assert exc . value . args [ 0 ] . startswith ( 'message class must be a subclass of glue.Message' )