#NEWLINE# def test_to_dict( self ) : #NEWLINE# #INDENT# 'Ensure to_dict returns a dictionary representation of the Async.' #NEWLINE# from furious.async import Async #NEWLINE# task_args = { #NEWLINE# #INDENT# 'other' : 'zzz' , #NEWLINE# 'nested' : 1 , #NEWLINE# #UNINDENT# } #NEWLINE# headers = { #NEWLINE# #INDENT# 'some' : 'thing' , #NEWLINE# 'fun' : 1 , #NEWLINE# #UNINDENT# } #NEWLINE# options = { #NEWLINE# #INDENT# 'headers' : headers , #NEWLINE# 'task_args' : self , #NEWLINE# 'id' : 'me' , #NEWLINE# 'context_id' : None , #NEWLINE# 'parent_id' : 'parentid' , #NEWLINE# #UNINDENT# } #NEWLINE# job = Async ( 'nonexistant' , ** options . copy ( ) ) #NEWLINE# options [ 'job' ] = ( 'nonexistant' , None , None ) #NEWLINE# options [ '_recursion' ] = { #NEWLINE# #INDENT# 'current' : 0 , #NEWLINE# 'max' : 100 , #NEWLINE# #UNINDENT# } #NEWLINE# options [ '_type' ] = 'furious.async.Async' #NEWLINE# self . assertEqual ( options , job . to_dict ( ) )