52 lines
1.5 KiB
Python
52 lines
1.5 KiB
Python
# SPDX-FileCopyrightText: 2026 Art Sea LLC
|
|
#
|
|
# SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
import argparse
|
|
import types
|
|
import pytest
|
|
from band_aider import first_aider
|
|
|
|
def test_is_module():
|
|
"""Verify that first_aider is a module."""
|
|
assert isinstance(first_aider, types.ModuleType)
|
|
|
|
def test_first_aider_exports():
|
|
"""Verify that first_aider exports the required symbols."""
|
|
assert first_aider.__all__ == ["build_parser", "decompose", "main"]
|
|
|
|
def test_build_parser_export():
|
|
"""Verify that build_parser returns a valid ArgumentParser."""
|
|
parser = first_aider.build_parser()
|
|
assert isinstance(parser, argparse.ArgumentParser)
|
|
|
|
|
|
def test_first_aider_repo_root_is_optional():
|
|
"""Verify first-aider does not force a default repo-root."""
|
|
|
|
args = first_aider.build_parser().parse_args(["prompt"])
|
|
|
|
assert args.repo_root is None
|
|
|
|
def test_exports_are_callable():
|
|
"""Verify that the exported symbols are callable."""
|
|
assert callable(first_aider.build_parser)
|
|
assert callable(first_aider.decompose)
|
|
assert callable(first_aider.main)
|
|
|
|
|
|
@pytest.mark.parametrize(
|
|
"flag",
|
|
[
|
|
"--task-profile",
|
|
"--batch-size",
|
|
"--focused-test-command",
|
|
"--broad-test-command",
|
|
"--final-test-command",
|
|
],
|
|
)
|
|
def test_first_aider_rejects_obsolete_passthrough_switches(flag):
|
|
"""Verify first-aider no longer forwards removed Band-Aider switches."""
|
|
|
|
with pytest.raises(SystemExit):
|
|
first_aider.build_parser().parse_args(["prompt", flag, "value"])
|