from src.main import parse_args


def test_parse_args(monkeypatch):
    monkeypatch.setattr("sys.argv", ["main.py", "--stage", "prod", "--port", "1234"])
    args = parse_args()
    assert args.stage == "prod"
    assert args.port == 1234


def test_parse_args_defaults(monkeypatch):
    monkeypatch.setattr("sys.argv", ["main.py"])
    args = parse_args()
    assert args.stage == "dev"
    assert args.port == 50051
