@@ -99,3 +99,23 @@ def test_vlan_list(self):
9999 result = self .run_command (['vlan' , 'list' ])
100100 self .assert_no_fail (result )
101101 self .assert_called_with ('SoftLayer_Account' , 'getNetworkVlans' )
102+
103+ @mock .patch ('SoftLayer.CLI.formatting.no_going_back' )
104+ def test_vlan_cancel (self , confirm_mock ):
105+ confirm_mock .return_value = True
106+ mock = self .set_mock ('SoftLayer_Network_Vlan' , 'getCancelFailureReasons' )
107+ mock .return_value = []
108+ result = self .run_command (['vlan' , 'cancel' , '1234' ])
109+ self .assert_no_fail (result )
110+
111+ @mock .patch ('SoftLayer.CLI.formatting.no_going_back' )
112+ def test_vlan_cancel_error (self , confirm_mock ):
113+ confirm_mock .return_value = True
114+ result = self .run_command (['vlan' , 'cancel' , '1234' ])
115+ self .assertTrue (result .exit_code , 2 )
116+
117+ @mock .patch ('SoftLayer.CLI.formatting.no_going_back' )
118+ def test_vlan_cancel_fail (self , confirm_mock ):
119+ confirm_mock .return_value = False
120+ result = self .run_command (['vlan' , 'cancel' , '1234' ])
121+ self .assertTrue (result .exit_code , 2 )
0 commit comments