#NEWLINE# def test_passwords_needed_at_start( self ) : #NEWLINE# #INDENT# "Establish that we are able to create a job that doesn't require\n        any invocation-time input.\n        " #NEWLINE# with client . test_mode as t : #NEWLINE# #INDENT# t . register_json ( '/job_templates/1/' , { #NEWLINE# #INDENT# 'id' : 1 , #NEWLINE# 'name' : 'frobnicate' , #NEWLINE# 'related' : { #NEWLINE# #INDENT# 'launch' : '/job_templates/1/launch/' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ) #NEWLINE# register_get ( t ) #NEWLINE# t . register_json ( '/job_templates/1/launch/' , { #NEWLINE# #INDENT# 'passwords_needed_to_start' : [ 'foo' ] , #NEWLINE# #UNINDENT# } , method = 'GET' ) #NEWLINE# t . register_json ( '/job_templates/1/launch/' , { #NEWLINE# #INDENT# 'job' : 42 , #NEWLINE# #UNINDENT# } , method = 'POST' ) #NEWLINE# with mock . patch ( 'tower_cli.resources.job.getpass' ) as getpass : #NEWLINE# #INDENT# getpass . return_value = 'bar' #NEWLINE# result = self . res . launch ( 1 ) #NEWLINE# getpass . assert_called_once_with ( 'Password for foo: ' ) #NEWLINE# #UNINDENT# self . assertDictContainsSubset ( { #NEWLINE# #INDENT# 'changed' : True , #NEWLINE# 'id' : 42 , #NEWLINE# #UNINDENT# } , result )