MCPcopy Create free account
hub / github.com/StackStorm/st2 / validate

Method validate

st2client/st2client/utils/interactive.py:119–128  ·  view source on GitHub ↗
(input, spec)

Source from the content-addressed store, hash-verified

117
118 @staticmethod
119 def validate(input, spec):
120 if not input and (not spec.get("required", None) or spec.get("default", None)):
121 return
122
123 if input.lower() not in POSITIVE_BOOLEAN | NEGATIVE_BOOLEAN:
124 raise validation.ValidationError(
125 len(input),
126 "Does not look like boolean. Pick from [%s]"
127 % ", ".join(POSITIVE_BOOLEAN | NEGATIVE_BOOLEAN),
128 )
129
130 def _construct_template(self):
131 self.template = "{0} (boolean)"

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected