#NEWLINE# def test_update_stats_for_instance_vm_change( self ) : #NEWLINE# #INDENT# instance = self . _create_instance ( ) #NEWLINE# self . stats . update_stats_for_instance ( instance ) #NEWLINE# instance [ 'vm_state' ] = vm_states . PAUSED #NEWLINE# self . stats . update_stats_for_instance ( instance ) #NEWLINE# self . assertEqual ( 1 , self . stats . num_instances ) #NEWLINE# self . assertEqual ( 1 , self . stats . num_instances_for_project ( 1234 ) ) #NEWLINE# self . assertEqual ( 1 , self . stats [ 'num_os_type_Linux' ] ) #NEWLINE# self . assertEqual ( 0 , self . stats [ ( 'num_vm_%s' % vm_states . BUILDING ) ] ) #NEWLINE# self . assertEqual ( 1 , self . stats [ ( 'num_vm_%s' % vm_states . PAUSED ) ] )