88from openkb .schema import AGENTS_MD
99
1010
11+ INIT_DEFAULT_INPUT = "\n \n "
12+
13+
1114def test_init_creates_structure (tmp_path ):
1215 runner = CliRunner ()
1316 with runner .isolated_filesystem (temp_dir = tmp_path ), \
1417 patch ("openkb.cli.register_kb" ):
15- result = runner .invoke (cli , ["init" ])
18+ result = runner .invoke (cli , ["init" ], input = INIT_DEFAULT_INPUT )
1619 assert result .exit_code == 0
1720
1821 from pathlib import Path
@@ -45,7 +48,7 @@ def test_init_schema_content(tmp_path):
4548 runner = CliRunner ()
4649 with runner .isolated_filesystem (temp_dir = tmp_path ), \
4750 patch ("openkb.cli.register_kb" ):
48- result = runner .invoke (cli , ["init" ])
51+ result = runner .invoke (cli , ["init" ], input = INIT_DEFAULT_INPUT )
4952 assert result .exit_code == 0
5053
5154 from pathlib import Path
@@ -58,7 +61,7 @@ def test_init_already_exists(tmp_path):
5861 with runner .isolated_filesystem (temp_dir = tmp_path ), \
5962 patch ("openkb.cli.register_kb" ):
6063 # First run should succeed
61- result = runner .invoke (cli , ["init" ])
64+ result = runner .invoke (cli , ["init" ], input = INIT_DEFAULT_INPUT )
6265 assert result .exit_code == 0
6366
6467 # Second run should print already initialized message
0 commit comments