Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit eb6feee

Browse files
authored
Merge pull request #2482 from RasmusWL/python-include-zope-web-tests
Python: include zope web tests from internal repo
2 parents 367827a + 8b5d6ae commit eb6feee

6 files changed

Lines changed: 37 additions & 0 deletions

File tree

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
| 12 | ControlFlowNode for implementer | class implementer | ../../../query-tests/Security/lib/zope/interface/__init__.py:5 |
2+
| 13 | ControlFlowNode for IThing | class IThing | test.py:4 |
3+
| 14 | ControlFlowNode for Thing | class Thing | test.py:9 |
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import python
2+
import semmle.python.TestUtils
3+
4+
from ControlFlowNode f, Value v, ControlFlowNode x
5+
where
6+
exists(ExprStmt s | s.getValue().getAFlowNode() = f) and
7+
f.pointsTo(v, x) and
8+
f.getLocation().getFile().getBaseName() = "test.py"
9+
select f.getLocation().getStartLine(), f.toString(), v.toString(),
10+
remove_library_prefix(x.getLocation())
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
semmle-extractor-options: --max-import-depth=3 -p ../../../query-tests/Security/lib/
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
from zope.interface import Interface, implementer
3+
4+
class IThing(Interface):
5+
pass
6+
7+
8+
@implementer(IThing)
9+
class Thing(object):
10+
pass
11+
12+
implementer
13+
IThing
14+
Thing

python/ql/test/query-tests/Security/lib/zope/__init__.py

Whitespace-only changes.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
class Interface():
2+
pass
3+
4+
5+
class implementer:
6+
7+
def __call__(self, ob):
8+
...
9+
return ob

0 commit comments

Comments
 (0)