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

Function test_simple_schema

pylint_plugins/api_models_test.py:88–105  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

86
87
88def test_simple_schema():
89 code = """
90 class ActionAPI(object):
91 schema = {"properties": {"action": {}}}
92 """
93
94 res = parse(code)
95
96 assert isinstance(res, nodes.Module)
97
98 class_node: nodes.ClassDef = res.body[0]
99 assert isinstance(class_node, nodes.ClassDef)
100
101 # action property added
102 assert "schema" in class_node.locals
103 assert "action" in class_node.locals
104 assert isinstance(class_node.locals["action"][0], nodes.AssignName)
105 assert class_node.locals["action"][0].name == "action"
106
107
108def test_copied_schema():

Callers

nothing calls this directly

Calls 1

parseFunction · 0.50

Tested by

no test coverage detected