mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
Merge pull request #2482 from RasmusWL/python-include-zope-web-tests
Python: include zope web tests from internal repo
This commit is contained in:
3
python/ql/test/library-tests/web/zope/Test.expected
Normal file
3
python/ql/test/library-tests/web/zope/Test.expected
Normal file
@@ -0,0 +1,3 @@
|
||||
| 12 | ControlFlowNode for implementer | class implementer | ../../../query-tests/Security/lib/zope/interface/__init__.py:5 |
|
||||
| 13 | ControlFlowNode for IThing | class IThing | test.py:4 |
|
||||
| 14 | ControlFlowNode for Thing | class Thing | test.py:9 |
|
||||
10
python/ql/test/library-tests/web/zope/Test.ql
Normal file
10
python/ql/test/library-tests/web/zope/Test.ql
Normal file
@@ -0,0 +1,10 @@
|
||||
import python
|
||||
import semmle.python.TestUtils
|
||||
|
||||
from ControlFlowNode f, Value v, ControlFlowNode x
|
||||
where
|
||||
exists(ExprStmt s | s.getValue().getAFlowNode() = f) and
|
||||
f.pointsTo(v, x) and
|
||||
f.getLocation().getFile().getBaseName() = "test.py"
|
||||
select f.getLocation().getStartLine(), f.toString(), v.toString(),
|
||||
remove_library_prefix(x.getLocation())
|
||||
1
python/ql/test/library-tests/web/zope/options
Normal file
1
python/ql/test/library-tests/web/zope/options
Normal file
@@ -0,0 +1 @@
|
||||
semmle-extractor-options: --max-import-depth=3 -p ../../../query-tests/Security/lib/
|
||||
14
python/ql/test/library-tests/web/zope/test.py
Normal file
14
python/ql/test/library-tests/web/zope/test.py
Normal file
@@ -0,0 +1,14 @@
|
||||
|
||||
from zope.interface import Interface, implementer
|
||||
|
||||
class IThing(Interface):
|
||||
pass
|
||||
|
||||
|
||||
@implementer(IThing)
|
||||
class Thing(object):
|
||||
pass
|
||||
|
||||
implementer
|
||||
IThing
|
||||
Thing
|
||||
@@ -0,0 +1,9 @@
|
||||
class Interface():
|
||||
pass
|
||||
|
||||
|
||||
class implementer:
|
||||
|
||||
def __call__(self, ob):
|
||||
...
|
||||
return ob
|
||||
Reference in New Issue
Block a user