Skip to content

Commit fc78cb4

Browse files
committed
fix tests
1 parent e66c26e commit fc78cb4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/test_cli.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,14 @@ def test_invalid_port():
2626
result = runner.invoke(app, ["--port", "99999"])
2727
assert result.exit_code == 2
2828
assert "Invalid value for '--port'" in result.stdout
29+
assert "99999" in result.stdout
2930

3031
def test_invalid_root():
3132
"""测试无效根目录"""
3233
result = runner.invoke(app, ["--root", "/nonexistent/path"])
3334
assert result.exit_code == 2
34-
assert "Invalid value for '--root'" in result.stdout
35+
for word in "Directory '/nonexistent/path' does not exist".split():
36+
assert word in result.stdout
3537

3638
@pytest.fixture
3739
def temp_dir(tmp_path):

0 commit comments

Comments
 (0)