MCPcopy Create free account
hub / github.com/SourceCode-AI/aura / test_any_of

Function test_any_of

tests/test_ast_pattern_matching.py:206–224  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

204
205
206def test_any_of():
207 src = "eval(print('Hello world'))"
208 sig = {
209 "pattern": [
210 "exec(...)",
211 "something",
212 "print(...)",
213 "x"
214 ],
215 "taint": "tainted"
216 }
217
218 compiled_src = ASTPattern._compile_src(src)
219 p = ASTPattern(sig)
220 v = PatternMatchingVisitor(pattern=p)
221 result = v.traverse(compiled_src)
222 assert result is not None
223 assert result.full_name == "print"
224 assert result._taint_class == Taints.TAINTED
225
226
227def disabled_test_decorator(): # TODO: add pattern matching for decorators

Callers

nothing calls this directly

Calls 4

traverseMethod · 0.95
ASTPatternClass · 0.90
_compile_srcMethod · 0.80

Tested by

no test coverage detected