personal memory agent
at main 31 lines 851 B view raw
1# SPDX-License-Identifier: AGPL-3.0-only 2# Copyright (c) 2026 sol pbc 3 4"""Tests for the sol config CLI.""" 5 6import json 7 8from think.config_cli import main 9 10 11def test_config_prints_json(monkeypatch, capsys): 12 """Default command prints full config JSON.""" 13 monkeypatch.setenv("_SOLSTONE_JOURNAL_OVERRIDE", "tests/fixtures/journal") 14 monkeypatch.setattr("sys.argv", ["sol config"]) 15 16 main() 17 18 output = capsys.readouterr().out 19 config = json.loads(output) 20 assert "identity" in config 21 22 23def test_config_env_prints_path(monkeypatch, capsys): 24 """env subcommand prints the journal path.""" 25 monkeypatch.setenv("_SOLSTONE_JOURNAL_OVERRIDE", "tests/fixtures/journal") 26 monkeypatch.setattr("sys.argv", ["sol config", "env"]) 27 28 main() 29 30 output = capsys.readouterr().out.strip() 31 assert output == "tests/fixtures/journal"