test_cli_args.py•1.26 kB
import pytest
from frida_mcp.cli import _parse_args
def test_parse_args_accepts_valid_remote_address():
args = _parse_args(["--remote-address", "example.com:1234"])
assert args.remote_address == "example.com:1234"
def test_parse_args_defaults_remote_port_when_omitted():
args = _parse_args(["--remote-address", "example.com"])
assert args.remote_address == "example.com:27042"
def test_parse_args_rejects_remote_address_with_embedded_flag_text():
with pytest.raises(SystemExit):
_parse_args(["--remote-address", "example.com:1234--log-level", "DEBUG"])
def test_parse_args_defaults_remote_port_when_empty_after_colon():
args = _parse_args(["--remote-address", "example.com:"])
assert args.remote_address == "example.com:27042"
def test_parse_args_rejects_unsupported_fallback_modes():
with pytest.raises(SystemExit):
_parse_args(["--fallback-order", "bluetooth,remote"])
def test_parse_args_requires_full_flag_names_when_abbrev_disabled():
with pytest.raises(SystemExit):
_parse_args(["--log-l", "DEBUG"])
def test_parse_args_returns_ordered_fallback_list():
args = _parse_args(["--fallback-order", "remote, usb, local"])
assert args.fallback_order == ["remote", "usb", "local"]