#NEWLINE# def test_set_primary_ip( self ) : #NEWLINE# #INDENT# ip1 = '10.10.4.110' #NEWLINE# ipcurr = '10.10.4.10' #NEWLINE# cases = [ ( ip1 , None , None , ( 'vrrp %d ip %s' % ( upd_vrid , ip1 ) ) ) , ( ip1 , True , None , ( 'no vrrp %d ip %s' % ( upd_vrid , ipcurr ) ) ) , ( ip1 , None , True , ( 'default vrrp %d ip %s' % ( upd_vrid , ipcurr ) ) ) , ( ip1 , True , True , ( 'default vrrp %d ip %s' % ( upd_vrid , ipcurr ) ) ) ] #NEWLINE# for ( primary_ip , disable , default , cmd ) in cases : #NEWLINE# #INDENT# func = function ( 'set_primary_ip' , upd_intf , upd_vrid , value = primary_ip , disable = disable , default = func ) #NEWLINE# exp_cmds = ( [ upd_cmd ] + [ cmd ] ) #NEWLINE# self . eapi_positive_config_test ( func , exp_cmds ) #NEWLINE# #UNINDENT# cases = [ 'abc' , 500 , '101.101' ] #NEWLINE# for primary_ip in cases : #NEWLINE# #INDENT# func = function ( 'set_primary_ip' , upd_intf , upd_vrid , value = primary_ip ) #NEWLINE# self . eapi_exception_config_test ( func , ValueError )