def testAddPreferredNetworkBadInterface(self):
    interface = 'enX'
    ssid = 'GuestNetwork'
    security = 'OPEN'
    args = [wifi_network_order._NETWORK_SETUP,
            '-addpreferredwirelessnetworkatindex', interface, ssid, '-1',
            security]
    self.mox.StubOutWithMock(wifi_network_order.gmacpyutil, 'RunProcess')
    wifi_network_order.gmacpyutil.RunProcess(
        args, sudo=False, sudo_password=None).AndReturn(
            ('\n', 'Bad interface name!\n', 1))
    self.mox.ReplayAll()
    with self.assertRaises(wifi_network_order.PreferenceAdditionError):
      wifi_network_order.AddPreferredNetwork(interface, ssid, security)

    self.mox.VerifyAll()
Test AddPreferredNetwork, bad interface name.
dataset/ETHPy150Open google/macops/gmacpyutil/gmacpyutil/wifi_network_order_test.py/WifiNetworkOrderModuleTest.testAddPreferredNetworkBadInterface