mirror of
https://github.com/github/codeql.git
synced 2026-05-01 11:45:14 +02:00
get basic module exports to work in API-graphs
This commit is contained in:
@@ -15,7 +15,11 @@ class ApiDefTest extends InlineExpectationsTest {
|
||||
// from the inline tests.
|
||||
not n instanceof DataFlow::ModuleVariableNode and
|
||||
exists(l.getFile().getRelativePath()) and
|
||||
n.getLocation().getFile().getBaseName().matches("def%.py")
|
||||
exists(File f | f = n.getLocation().getFile() |
|
||||
f.getBaseName().matches("def%.py")
|
||||
or
|
||||
f.getAbsolutePath().matches("%/mypkg/%")
|
||||
)
|
||||
}
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
foo = 42
|
||||
# TODO: Shortcurcuit the __init__ package.
|
||||
foo = 42 #$ def=moduleImport("mypkg").getMember("__init__").getMember("foo")
|
||||
|
||||
@@ -1 +1 @@
|
||||
pass
|
||||
value = 3 #$ def=moduleImport("mypkg").getMember("foo").getMember("value")
|
||||
Reference in New Issue
Block a user