@@ -21,7 +21,7 @@ def test_list_firewalls(self):
2121 @mock .patch ('SoftLayer.CLI.formatting.confirm' )
2222 def test_add_vs (self , confirm_mock ):
2323 confirm_mock .return_value = True
24- result = self .run_command (['firewall' , 'add' , '1000' , '--firewall-type=vlan' , '-ha ' ])
24+ result = self .run_command (['firewall' , 'add' , '1000' , '--firewall-type=vlan' , '-h ' ])
2525 self .assert_no_fail (result )
2626 self .assertIn ("Firewall is being created!" , result .output )
2727
@@ -158,3 +158,24 @@ def test_edit(self, confirm_mock):
158158 def test_monitoring (self ):
159159 result = self .run_command (['firewall' , 'monitoring' , '123456' ])
160160 print (result .output )
161+
162+ @mock .patch ('SoftLayer.CLI.formatting.confirm' )
163+ def test_add_firewall_force (self , confirm_mock ):
164+ confirm_mock .return_value = False
165+ result = self .run_command (['firewall' , 'add' , '1000' , '--firewall-type=vlan' , '-h' , '--force' ])
166+ self .assert_no_fail (result )
167+ self .assertIn ("Firewall is being created!" , result .output )
168+
169+ @mock .patch ('SoftLayer.CLI.formatting.confirm' )
170+ def test_add_firewall_no_force (self , confirm_mock ):
171+ confirm_mock .return_value = False
172+ result = self .run_command (['firewall' , 'add' , '1000' , '--firewall-type=vlan' , '-h' ])
173+ self .assertEqual (2 , result .exit_code )
174+
175+ @mock .patch ('SoftLayer.CLI.formatting.confirm' )
176+ def test_cancel_firewall_no_force (self , confirm_mock ):
177+ confirm_mock .return_value = False
178+ result = self .run_command (['firewall' , 'cancel' , 'vlan:1234' ])
179+ self .assertEqual (2 , result .exit_code )
180+ print (result .output )
181+ self .assertEqual ('Aborted.' , result .exception .message )
0 commit comments