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

Function test_inlined_schema

pylint_plugins/api_models_test.py:197–217  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

195
196
197def test_inlined_schema():
198 code = """
199 from %s import TriggerAPI
200
201 class ActionExecutionAPI(object):
202 schema = {"properties": {"trigger": TriggerAPI.schema}}
203 """
204 code = code % FIXTURE_MODULE_TRIGGER
205
206 res = parse(code)
207
208 assert isinstance(res, nodes.Module)
209
210 class_node: nodes.ClassDef = res.body[1]
211 assert isinstance(class_node, nodes.ClassDef)
212
213 assert "schema" in class_node.locals
214 assert "trigger" in class_node.locals
215
216 attribute_value_node = next(class_node.locals["trigger"][0].infer())
217 assert isinstance(attribute_value_node, nodes.Dict)
218
219
220def test_property_types():

Callers

nothing calls this directly

Calls 1

parseFunction · 0.50

Tested by

no test coverage detected