Skip to content

Commit

Permalink
add init local test
Browse files Browse the repository at this point in the history
  • Loading branch information
ThejasNU committed Jan 29, 2025
1 parent 38d4baa commit 1a75f35
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions libs/agentc_cli/tests/test_click.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,3 +478,31 @@ def test_ls_local_both_tools_prompts(tmp_path):
assert "TOOL" in output and len(re.findall(r"\b1\.\s.+", output)) == 1
output = runner.invoke(click_main, ["ls", "-local"]).stdout
assert "PROMPT" in output and "TOOL" in output and len(re.findall(r"\b1\.\s.+", output)) == 2


@pytest.mark.smoke
def test_init_local(tmp_path):
runner = click.testing.CliRunner()
with runner.isolated_filesystem(temp_dir=tmp_path):
files_present = os.listdir()
assert ".agent-catalog" not in files_present and ".agent-activity" not in files_present

runner.invoke(click_main, ["init", "local", "catalog"])
files_present = os.listdir()
assert ".agent-catalog" in files_present and ".agent-activity" not in files_present

runner.invoke(click_main, ["init", "local", "auditor"])
files_present = os.listdir()
assert ".agent-catalog" in files_present and ".agent-activity" in files_present


@pytest.mark.smoke
def test_init_local_all(tmp_path):
runner = click.testing.CliRunner()
with runner.isolated_filesystem(temp_dir=tmp_path):
files_present = os.listdir()
assert ".agent-catalog" not in files_present and ".agent-activity" not in files_present

runner.invoke(click_main, ["init", "local", "all"])
files_present = os.listdir()
assert ".agent-catalog" in files_present and ".agent-activity" in files_present

0 comments on commit 1a75f35

Please sign in to comment.