#NEWLINE# def test_state_computation( self ) : #NEWLINE# #INDENT# instance = { #NEWLINE# #INDENT# 'vm_state' : mock . sentinel . vm_state , #NEWLINE# 'task_state' : mock . sentinel . task_state , #NEWLINE# #UNINDENT# } #NEWLINE# states = notifications . _compute_states_payload ( instance ) #NEWLINE# self . assertEqual ( mock . sentinel . vm_state , states [ 'state' ] ) #NEWLINE# self . assertEqual ( mock . sentinel . vm_state , states [ 'old_state' ] ) #NEWLINE# self . assertEqual ( mock . sentinel . task_state , states [ 'old_task_state' ] ) #NEWLINE# self . assertEqual ( mock . sentinel . task_state , states [ 'new_task_state' ] ) #NEWLINE# states = notifications . _compute_states_payload ( instance , old_vm_state = mock . sentinel . old_vm_state ) #NEWLINE# self . assertEqual ( mock . sentinel . vm_state , states [ 'state' ] ) #NEWLINE# self . assertEqual ( mock . sentinel . old_vm_state , states [ 'old_state' ] ) #NEWLINE# self . assertEqual ( mock . sentinel . task_state , states [ 'old_task_state' ] ) #NEWLINE# self . assertEqual ( mock . sentinel . task_state , states [ 'new_task_state' ] ) #NEWLINE# states = notifications . _compute_states_payload ( instance , old_vm_state = mock . sentinel . old_vm_state , old_task_state = mock . sentinel . old_task_state , new_vm_state = mock . sentinel . new_vm_state , new_task_state = mock . sentinel . new_task_state ) #NEWLINE# self . assertEqual ( mock . sentinel . new_vm_state , states [ 'state' ] ) #NEWLINE# self . assertEqual ( mock . sentinel . old_vm_state , states [ 'old_state' ] ) #NEWLINE# self . assertEqual ( mock . sentinel . old_task_state , states [ 'old_task_state' ] ) #NEWLINE# self . assertEqual ( mock . sentinel . new_task_state , states [ 'new_task_state' ] )