()
| 204 | |
| 205 | |
| 206 | def 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 | |
| 227 | def disabled_test_decorator(): # TODO: add pattern matching for decorators |
nothing calls this directly
no test coverage detected