Python: Rewrite inline expectation tests to use parameterized module

This commit is contained in:
Jeroen Ketema
2023-06-07 13:37:23 +02:00
parent 49993b023e
commit 8f599faf85
28 changed files with 105 additions and 84 deletions

View File

@@ -8,12 +8,10 @@ import TestUtilities.InlineExpectationsTest
import semmle.python.dataflow.new.SensitiveDataSources
private import semmle.python.ApiGraphs
class SensitiveDataSourcesTest extends InlineExpectationsTest {
SensitiveDataSourcesTest() { this = "SensitiveDataSourcesTest" }
module SensitiveDataSourcesTest implements TestSig {
string getARelevantTag() { result in ["SensitiveDataSource", "SensitiveUse"] }
override string getARelevantTag() { result in ["SensitiveDataSource", "SensitiveUse"] }
override predicate hasActualResult(Location location, string element, string tag, string value) {
predicate hasActualResult(Location location, string element, string tag, string value) {
exists(location.getFile().getRelativePath()) and
exists(SensitiveDataSource source |
location = source.getLocation() and
@@ -32,6 +30,8 @@ class SensitiveDataSourcesTest extends InlineExpectationsTest {
}
}
import MakeTest<SensitiveDataSourcesTest>
class SensitiveUseConfiguration extends TaintTracking::Configuration {
SensitiveUseConfiguration() { this = "SensitiveUseConfiguration" }