def test_set_frequency(hostname, port, fake_target): DEFAULT_CONFIG["hostname"] = "127.0.0.1" DEFAULT_CONFIG["port"] = "80" rigctl = RigCtl(fake_target) rigctl._request = MagicMock() rigctl.set_frequency("1000000") rigctl._request.assert_called_once_with('F 1000000', None)
def test_set_frequency(): rigctl = RigCtl() with pytest.raises(ValueError): rigctl.set_frequency("test")
def test_set_connection_refused(hostname, port): DEFAULT_CONFIG["hostname"] = hostname DEFAULT_CONFIG["port"] = port rigctl = RigCtl() with pytest.raises(socket.error): rigctl.set_frequency("1000000")
def test_set_bad_frequency(fake_target): rigctl = RigCtl(fake_target) with pytest.raises(ValueError): rigctl.set_frequency("test")