Issue #46: implement Python async client values errors and CLI

This commit is contained in:
Joseph Doherty
2026-04-26 20:46:18 -04:00
parent 14afb325c3
commit b57662aae7
14 changed files with 1883 additions and 10 deletions
+48 -1
View File
@@ -1,4 +1,4 @@
"""Tests for the Python CLI scaffold."""
"""Tests for the Python CLI."""
import json
@@ -19,3 +19,50 @@ def test_version_json_is_deterministic() -> None:
"package": "mxaccess-gateway-client",
"version": __version__,
}
def test_write_parser_rejects_unknown_value_type() -> None:
runner = CliRunner()
result = runner.invoke(
main,
[
"write",
"--session-id",
"session-1",
"--server-handle",
"12",
"--item-handle",
"34",
"--type",
"unsupported",
"--value",
"123",
"--api-key",
"mxgw_test_secret",
"--json",
],
)
assert result.exit_code != 0
assert "unsupported value type" in result.output
def test_cli_error_output_redacts_api_key() -> None:
runner = CliRunner()
result = runner.invoke(
main,
[
"open-session",
"--endpoint",
"127.0.0.1:1",
"--api-key",
"mxgw_test_secret",
"--plaintext",
"--json",
],
)
assert result.exit_code != 0
assert "mxgw_test_secret" not in result.output