MCPcopy Create free account
hub / github.com/hugapi/hug / test_cli

Function test_cli

tests/test_test.py:29–41  ·  view source on GitHub ↗

Test to ensure the CLI tester works as intended to allow testing CLI endpoints

()

Source from the content-addressed store, hash-verified

27
28
29def test_cli():
30 """Test to ensure the CLI tester works as intended to allow testing CLI endpoints"""
31
32 @hug.cli()
33 def my_cli_function():
34 return "Hello"
35
36 assert hug.test.cli(my_cli_function) == "Hello"
37 assert hug.test.cli("my_cli_function", api=api) == "Hello"
38
39 # Shouldn't be able to specify both api and module.
40 with pytest.raises(ValueError):
41 assert hug.test.cli("my_method", api=api, module=hug)

Callers

nothing calls this directly

Calls 1

cliMethod · 0.45

Tested by

no test coverage detected