#NEWLINE# def test_vm_update_with_states( self ) : #NEWLINE# #INDENT# notifications . send_update_with_states ( self . context , self . instance , vm_states . BUILDING , vm_states . ACTIVE , task_states . SPAWNING , task_states . SPAWNING , verify_states = True ) #NEWLINE# self . assertEqual ( 1 , len ( fake_notifier . NOTIFICATIONS ) ) #NEWLINE# notif = fake_notifier . NOTIFICATIONS [ 0 ] #NEWLINE# payload = notif . payload #NEWLINE# access_ip_v4 = str ( self . instance . access_ip_v4 ) #NEWLINE# access_ip_v6 = str ( self . instance . access_ip_v6 ) #NEWLINE# display_name = self . instance . display_name #NEWLINE# hostname = self . instance . hostname #NEWLINE# node = self . instance . node #NEWLINE# self . assertEqual ( vm_states . BUILDING , payload [ 'old_state' ] ) #NEWLINE# self . assertEqual ( vm_states . ACTIVE , payload [ 'state' ] ) #NEWLINE# self . assertEqual ( task_states . SPAWNING , payload [ 'old_task_state' ] ) #NEWLINE# self . assertEqual ( task_states . SPAWNING , payload [ 'new_task_state' ] ) #NEWLINE# self . assertEqual ( payload [ 'access_ip_v4' ] , access_ip_v4 ) #NEWLINE# self . assertEqual ( payload [ 'access_ip_v6' ] , access_ip_v6 ) #NEWLINE# self . assertEqual ( payload [ 'display_name' ] , display_name ) #NEWLINE# self . assertEqual ( payload [ 'hostname' ] , hostname ) #NEWLINE# self . assertEqual ( self [ 'node' ] , node )