Python: Update more inline expectation tests to use the paramterized module

This commit is contained in:
Jeroen Ketema
2023-06-15 16:44:04 +02:00
parent c53e529bac
commit dba4460526
153 changed files with 551 additions and 379 deletions

View File

@@ -1,2 +1,3 @@
missingAnnotationOnSink
failures
testFailures

View File

@@ -0,0 +1,2 @@
failures
testFailures

View File

@@ -2,11 +2,13 @@ import python
import experimental.dataflow.TestUtil.UnresolvedCalls
private import semmle.python.dataflow.new.DataFlow
class IgnoreDictMethod extends UnresolvedCallExpectations {
override predicate unresolvedCall(CallNode call) {
super.unresolvedCall(call) and
module IgnoreDictMethod implements UnresolvedCallExpectationsSig {
predicate unresolvedCall(CallNode call) {
DefaultUnresolvedCallExpectations::unresolvedCall(call) and
not any(DataFlow::MethodCallNode methodCall |
methodCall.getMethodName() in ["get", "setdefault"]
).asCfgNode() = call
}
}
import MakeUnresolvedCallExpectations<IgnoreDictMethod>