#NEWLINE# @ mock_elb #NEWLINE# def test_connection_draining_attribute( ) : #NEWLINE# #INDENT# conn = boto . connect_elb ( ) #NEWLINE# ports = [ ( 80 , 8080 , 'http' ) , ( 443 , 8443 , 'tcp' ) ] #NEWLINE# lb = conn . create_load_balancer ( 'my-lb' , [ ] , ports ) #NEWLINE# connection_draining = ConnectionDrainingAttribute ( ) #NEWLINE# connection_draining . enabled = True #NEWLINE# connection_draining . timeout = 60 #NEWLINE# conn . modify_lb_attribute ( 'my-lb' , 'ConnectionDraining' , connection_draining ) #NEWLINE# attributes = lb . get_attributes ( force = True ) #NEWLINE# attributes . connection_draining . enabled . should . be . true #NEWLINE# attributes . connection_draining . timeout . should . equal ( 60 ) #NEWLINE# connection_draining . timeout = 30 #NEWLINE# conn . modify_lb_attribute ( 'my-lb' , 'ConnectionDraining' , connection_draining ) #NEWLINE# attributes = lb . get_attributes ( force = True ) #NEWLINE# attributes . connection_draining . timeout . should . equal ( 30 ) #NEWLINE# connection_draining . enabled = False #NEWLINE# conn . modify_lb_attribute ( 'my-lb' , 'ConnectionDraining' , connection_draining ) #NEWLINE# attributes = lb . get_attributes ( force = True ) #NEWLINE# attributes . connection_draining . enabled . should . be . false