mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
Python: Descriptor tests fixup (2/3)
Test format improved
This commit is contained in:
@@ -1 +1,2 @@
|
||||
| 3 | Property f | 4 | Function f | 8 | Function f |
|
||||
| test.py:4:5:4:16 | Function f | getter | test.py:3:6:3:13 | Property f |
|
||||
| test.py:8:5:8:23 | Function f | setter | test.py:3:6:3:13 | Property f |
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
|
||||
import python
|
||||
import semmle.python.types.Descriptors
|
||||
|
||||
int lineof(Object o) {
|
||||
result = o.getOrigin().getLocation().getStartLine()
|
||||
}
|
||||
|
||||
from PropertyObject p, FunctionObject getter, FunctionObject setter
|
||||
from PropertyObject p, string method_name, FunctionObject method
|
||||
where
|
||||
getter = p.getGetter() and setter = p.getSetter()
|
||||
select lineof(p), p.toString(), lineof(getter), getter.toString(), lineof(setter), setter.toString()
|
||||
|
||||
method_name = "getter" and method = p.getGetter()
|
||||
or
|
||||
method_name = "setter" and method = p.getSetter()
|
||||
or
|
||||
method_name = "deleter" and method = p.getDeleter()
|
||||
select method, method_name, p
|
||||
|
||||
Reference in New Issue
Block a user