'Tests is_interface_valid when the adapter is required as monitor and is not managed by
NetworkManager'

def test_is_interface_valid_mode_ap_is_managed_by_nm_true(self):

    interface_name = 'wlan0'
    adapter = interfaces.NetworkAdapter(interface_name, 'CARD', '00:00:00:00:00:00')
    adapter.is_managed_by_nm = False
    adapter.has_ap_mode = True
    self.network_manager._name_to_object[interface_name] = adapter
    actual = self.network_manager.is_interface_valid(interface_name, 'AP')
    message = 'Failed    to    validate    an    interface    with    AP    mode'
    self.assertTrue(actual, message)
