#NEWLINE# def test_extra_vars_at_call_time( self ) : #NEWLINE# #INDENT# 'Establish that extra variables specified at call time are\n        appropriately specified.\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# #NEWLINE# #UNINDENT# } , method = 'GET' ) #NEWLINE# t . register_json ( '/job_templates/1/launch/' , { #NEWLINE# #INDENT# 'job' : 42 , #NEWLINE# #UNINDENT# } , method = 'POST' ) #NEWLINE# result = self . res . launch ( 1 , extra_vars = [ 'foo: bar' ] ) #NEWLINE# self . assertDictContainsSubset ( { #NEWLINE# #INDENT# 'foo' : 'bar' , #NEWLINE# #UNINDENT# } , json . loads ( json . loads ( t . requests [ 2 ] . body ) [ 'extra_vars' ] ) ) #NEWLINE# self . assertDictContainsSubset ( { #NEWLINE# #INDENT# 'changed' : True , #NEWLINE# 'id' : 42 , #NEWLINE# #UNINDENT# } , result )