mirror of
https://github.com/github/codeql.git
synced 2026-05-05 13:45:19 +02:00
Python: Rewrite inline expectation tests to use parameterized module
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
failures
|
||||
testFailures
|
||||
|
||||
@@ -4,17 +4,15 @@ import TestUtilities.InlineExpectationsTest
|
||||
import semmle.python.functions.ModificationOfParameterWithDefault
|
||||
private import semmle.python.dataflow.new.internal.PrintNode
|
||||
|
||||
class ModificationOfParameterWithDefaultTest extends InlineExpectationsTest {
|
||||
ModificationOfParameterWithDefaultTest() { this = "ModificationOfParameterWithDefaultTest" }
|
||||
module ModificationOfParameterWithDefaultTest implements TestSig {
|
||||
string getARelevantTag() { result = "modification" }
|
||||
|
||||
override string getARelevantTag() { result = "modification" }
|
||||
|
||||
predicate relevant_node(DataFlow::Node sink) {
|
||||
private predicate relevant_node(DataFlow::Node sink) {
|
||||
exists(ModificationOfParameterWithDefault::Configuration cfg | cfg.hasFlowTo(sink))
|
||||
}
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
exists(DataFlow::Node n | this.relevant_node(n) |
|
||||
predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
exists(DataFlow::Node n | relevant_node(n) |
|
||||
n.getLocation() = location and
|
||||
tag = "modification" and
|
||||
value = prettyNode(n) and
|
||||
@@ -22,3 +20,5 @@ class ModificationOfParameterWithDefaultTest extends InlineExpectationsTest {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import MakeTest<ModificationOfParameterWithDefaultTest>
|
||||
|
||||
Reference in New Issue
Block a user