#NEWLINE# def test_get_command_raises_reasonable_errors( go_server ) : #NEWLINE# #INDENT# with pytest . raises ( ImportError ) as exc : #NEWLINE# #INDENT# gocd_cli . utils . get_command ( go_server , 'no-such-module' , 'retrigger-failed' ) #NEWLINE# #UNINDENT# assert ( 'gocd_cli.commands:' in str ( exc ) ) #NEWLINE# with pytest . raises ( AttributeError ) as exc : #NEWLINE# #INDENT# gocd_cli . utils . get_command ( go_server , 'pipeline' , 'no-such-command' ) #NEWLINE# #UNINDENT# assert ( 'gocd_cli.commands.pipeline' in str ( exc ) ) #NEWLINE# assert ( "object has no attribute 'NoSuchCommand'" in str ( exc ) ) #NEWLINE# with pytest . raises ( TypeError ) as exc : #NEWLINE# #INDENT# gocd_cli . utils . get_command ( go_server , 'pipeline' , 'retrigger-failed' ) #NEWLINE# #UNINDENT# assert ( 'RetriggerFailed' in str ( exc ) ) #NEWLINE# assert ( '__init__() takes at least 3 arguments (2 given)' in str ( exc ) )