#NEWLINE# def testCreateFirewall_notCreated( self ) : #NEWLINE# #INDENT# 'Unit test of CreateFirewall() with no firewall created.' #NEWLINE# mock_api = MagicMock ( name = 'Mock Google Client API' ) #NEWLINE# self . gce_api . GetApi = MagicMock ( return_value = self ) #NEWLINE# mock_api . firewalls . return_value . get . return_value . execute . return_value = { #NEWLINE# #INDENT# 'name' : 'firewall-name' , #NEWLINE# #UNINDENT# } #NEWLINE# self . assertTrue ( self . gce_api . CreateFirewall ( 'firewall-name' , [ { #NEWLINE# #INDENT# 'IPProtocol' : 'tcp' , #NEWLINE# #UNINDENT# } ] ) ) #NEWLINE# self . assertFalse ( mock_api . firewalls . return_value . insert . called )