'Test is_interface_valid method when interface is already been chosen'

def test_is_interface_valid_invalid_interface_error(self):

    interface_name = 'wlan0'
    interface_object = 'Card    Object'
    adapter = interfaces.NetworkAdapter(interface_name, interface_object, self.mac_address)
    self.network_manager._name_to_object[interface_name] = adapter
    self.network_manager._active.add(interface_name)
    with self.assertRaises(interfaces.InvalidInterfaceError):
        self.network_manager.is_interface_valid(interface_name)
