mirror of
https://github.com/github/codeql.git
synced 2026-04-26 01:05:15 +02:00
Python: add test for crosstalk
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
| test_crosstalk.py:8:16:8:18 | ControlFlowNode for f() | bar |
|
||||
| test_crosstalk.py:8:16:8:18 | ControlFlowNode for f() | baz |
|
||||
| test_crosstalk.py:13:16:13:18 | ControlFlowNode for g() | bar |
|
||||
| test_crosstalk.py:13:16:13:18 | ControlFlowNode for g() | baz |
|
||||
13
python/ql/test/library-tests/ApiGraphs/py3/test_crosstalk.py
Normal file
13
python/ql/test/library-tests/ApiGraphs/py3/test_crosstalk.py
Normal file
@@ -0,0 +1,13 @@
|
||||
|
||||
def outer():
|
||||
from foo import bar, baz
|
||||
|
||||
def inner_bar():
|
||||
f = bar
|
||||
g = baz
|
||||
return f()
|
||||
|
||||
def inner_baz():
|
||||
f = bar
|
||||
g = baz
|
||||
return g()
|
||||
@@ -0,0 +1,8 @@
|
||||
import python
|
||||
import semmle.python.ApiGraphs
|
||||
|
||||
from API::CallNode callNode, string member
|
||||
where
|
||||
callNode = API::moduleImport("foo").getMember(member).getACall() and
|
||||
callNode.getLocation().getFile().getBaseName() = "test_crosstalk.py"
|
||||
select callNode, member
|
||||
Reference in New Issue
Block a user