Merge pull request #2482 from RasmusWL/python-include-zope-web-tests

Python: include zope web tests from internal repo
This commit is contained in:
Taus
2019-12-18 13:55:23 +01:00
committed by GitHub
6 changed files with 37 additions and 0 deletions

View 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 |

View 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())

View File

@@ -0,0 +1 @@
semmle-extractor-options: --max-import-depth=3 -p ../../../query-tests/Security/lib/

View File

@@ -0,0 +1,14 @@
from zope.interface import Interface, implementer
class IThing(Interface):
pass
@implementer(IThing)
class Thing(object):
pass
implementer
IThing
Thing

View File

@@ -0,0 +1,9 @@
class Interface():
pass
class implementer:
def __call__(self, ob):
...
return ob