MCPcopy
hub / github.com/hugapi/hug / test_cli_interface_api_with_exit_codes

Function test_cli_interface_api_with_exit_codes

tests/test_api.py:100–116  ·  view source on GitHub ↗
(hug_api_error_exit_codes_enabled)

Source from the content-addressed store, hash-verified

98
99
100def test_cli_interface_api_with_exit_codes(hug_api_error_exit_codes_enabled):
101 api = hug_api_error_exit_codes_enabled
102
103 @hug.object(api=api)
104 class TrueOrFalse:
105 @hug.object.cli
106 def true(self):
107 return True
108
109 @hug.object.cli
110 def false(self):
111 return False
112
113 api.cli(args=[None, "true"])
114
115 with pytest.raises(SystemExit):
116 api.cli(args=[None, "false"])
117
118
119def test_cli_interface_api_without_exit_codes():

Callers

nothing calls this directly

Calls 1

cliMethod · 0.45

Tested by

no test coverage detected