Function
test_cli_interface_api_with_exit_codes
(hug_api_error_exit_codes_enabled)
Source from the content-addressed store, hash-verified
| 98 | |
| 99 | |
| 100 | def 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 | |
| 119 | def test_cli_interface_api_without_exit_codes(): |
Callers
nothing calls this directly
Tested by
no test coverage detected