#NEWLINE# def test_get_lowstate( self ) : #NEWLINE# #INDENT# '\n        Test transformations low data of the function _get_lowstate\n        ' #NEWLINE# valid_lowstate = [ { #NEWLINE# #INDENT# 'client' : 'local' , #NEWLINE# 'tgt' : '*' , #NEWLINE# 'fun' : 'test.fib' , #NEWLINE# 'arg' : [ '10' ] , #NEWLINE# #UNINDENT# } ] #NEWLINE# request_lowstate = { #NEWLINE# #INDENT# 'client' : 'local' , #NEWLINE# 'tgt' : '*' , #NEWLINE# 'fun' : 'test.fib' , #NEWLINE# 'arg' : [ '10' ] , #NEWLINE# #UNINDENT# } #NEWLINE# response = self . fetch ( '/' , method = 'POST' , body = json . dumps ( request_lowstate ) , headers = { #NEWLINE# #INDENT# 'Content-Type' : self . content_type_map [ 'json' ] , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertEqual ( valid_lowstate , json . loads ( response . body ) [ 'lowstate' ] ) #NEWLINE# request_lowstate = [ { #NEWLINE# #INDENT# 'client' : 'local' , #NEWLINE# 'tgt' : '*' , #NEWLINE# 'fun' : 'test.fib' , #NEWLINE# 'arg' : '10' , #NEWLINE# #UNINDENT# } ] #NEWLINE# response = self . fetch ( '/' , method = 'POST' , body = json . dumps ( request_lowstate ) , headers = { #NEWLINE# #INDENT# 'Content-Type' : request_form_lowstate . content_type_map [ 'json' ] , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertEqual ( valid_lowstate , json . loads ( response . body ) [ 'lowstate' ] ) #NEWLINE# request_lowstate = { #NEWLINE# #INDENT# 'client' : 'local' , #NEWLINE# 'tgt' : '*' , #NEWLINE# 'fun' : 'test.fib' , #NEWLINE# 'arg' : '10' , #NEWLINE# #UNINDENT# } #NEWLINE# response = self . fetch ( '/' , method = 'POST' , body = json . dumps ( request_lowstate ) , headers = { #NEWLINE# #INDENT# 'Content-Type' : self . content_type_map [ 'json' ] , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertEqual ( valid_lowstate , json . loads ( response . body ) [ 'lowstate' ] ) #NEWLINE# response = self . fetch ( '/' , method = 'POST' , body = yaml . dump ( request_lowstate ) , headers = { #NEWLINE# #INDENT# 'Content-Type' : self . content_type_map [ 'yaml' ] , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertEqual ( valid_lowstate , json . loads ( response . body ) [ 'lowstate' ] ) #NEWLINE# response = self . fetch ( '/' , method = 'POST' , body = json . dumps ( request_lowstate ) , headers = { #NEWLINE# #INDENT# 'Content-Type' : self . content_type_map [ 'text' ] , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertEqual ( valid_lowstate , json . loads ( response . body ) [ 'lowstate' ] ) #NEWLINE# request_form_lowstate = ( ( 'client' , 'local' ) , ( 'tgt' , '*' ) , ( 'fun' , 'test.fib' ) , ( 'arg' , '10' ) ) #NEWLINE# response = self . fetch ( '/' , method = 'POST' , body = urlencode ( request_form_lowstate ) , headers = { #NEWLINE# #INDENT# 'Content-Type' : self . content_type_map [ 'form' ] , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertEqual ( valid_lowstate , json . loads ( response . body ) [ 'lowstate' ] )