#NEWLINE# def testRemovePreferredNetworkFailure( self ) : #NEWLINE# #INDENT# 'Test RemovePreferredNetwork with a bad interface and network.' #NEWLINE# interface = 'enX' #NEWLINE# ssid = 'NetworkThatDoesntExist' #NEWLINE# args = ( wifi_network_order . _NETWORK_SETUP , '-removepreferredwirelessnetwork' , interface , interface ) #NEWLINE# self . mox . StubOutWithMock ( wifi_network_order . gmacpyutil , 'RunProcess' ) #NEWLINE# wifi_network_order . gmacpyutil . RunProcess ( args , sudo = False , sudo_password = None ) . AndReturn ( ( 'enX does not exist\n' , 'An error occurred\n' , 1 ) ) #NEWLINE# self . mox . ReplayAll ( ) #NEWLINE# with self . assertRaises ( wifi_network_order . PreferenceRemovalError ) : #NEWLINE# #INDENT# wifi_network_order . RemovePreferredNetwork ( interface , ssid ) #NEWLINE# #UNINDENT# self . mox . VerifyAll ( )