Skip to content

Commit 0c3d26f

Browse files
authored
Merge pull request #31 from saccharin98/pytest_debug
fix: pytest openkb init [ENTER] added
2 parents c553321 + 9457118 commit 0c3d26f

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

tests/test_cli.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,14 @@
88
from openkb.schema import AGENTS_MD
99

1010

11+
INIT_DEFAULT_INPUT = "\n\n"
12+
13+
1114
def 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

Comments
 (0)