MCPcopy Create free account
hub / github.com/IBM/mcp-cli / test_format_output

Method test_format_output

tests/commands/test_base.py:180–194  ·  view source on GitHub ↗

Test output formatting.

(self)

Source from the content-addressed store, hash-verified

178 assert result.output == "Test executed"
179
180 def test_format_output(self):
181 """Test output formatting."""
182 cmd = DummyCommand()
183
184 # Test with output
185 result = CommandResult(success=True, output="Test output")
186 assert cmd.format_output(result, CommandMode.CHAT) == "Test output"
187
188 # Test with error
189 result = CommandResult(success=False, error="Test error")
190 assert cmd.format_output(result, CommandMode.CHAT) == "Error: Test error"
191
192 # Test with neither
193 result = CommandResult(success=True)
194 assert cmd.format_output(result, CommandMode.CHAT) == ""
195
196 def test_validate_parameters(self):
197 """Test parameter validation."""

Callers

nothing calls this directly

Calls 3

CommandResultClass · 0.90
format_outputMethod · 0.80
DummyCommandClass · 0.70

Tested by

no test coverage detected