def test_wpacli_stop_p2p_find(monkeypatch): def mockreturn(self, *arg): assert arg == ('p2p_stop_find', ) return "OK" monkeypatch.setattr(WpaCli, "cmd", mockreturn) wpacli = WpaCli() wpacli.stop_p2p_find()
def test_wpacli_stop_p2p_find_negative(monkeypatch): def mockreturn(self, *arg): assert arg == ('p2p_stop_find', ) return "FAILED" monkeypatch.setattr(WpaCli, "cmd", mockreturn) wpacli = WpaCli() with pytest.raises(WpaException): wpacli.stop_p2p_find()