зеркало из https://github.com/github/codeql.git
Python: Update tests to account for packages having locations.
This commit is contained in:
Родитель
c1b8f500c7
Коммит
d46467f526
|
@ -403,6 +403,7 @@
|
|||
| i_imports.py:18 | ControlFlowNode for sys | Module sys | builtin-class module | 17 | import |
|
||||
| i_imports.py:23 | ControlFlowNode for ImportExpr | Module code | builtin-class module | 23 | import |
|
||||
| i_imports.py:23 | ControlFlowNode for code | Module code | builtin-class module | 23 | import |
|
||||
| i_imports.py:24 | ControlFlowNode for Attribute | Module code.package | builtin-class module | 0 | import |
|
||||
| i_imports.py:24 | ControlFlowNode for Attribute | Module code.package.x | builtin-class module | 0 | import |
|
||||
| i_imports.py:24 | ControlFlowNode for code | Module code | builtin-class module | 23 | import |
|
||||
| i_imports.py:27 | ControlFlowNode for ImportExpr | Module code.test_package | builtin-class module | 27 | import |
|
||||
|
|
|
@ -512,6 +512,7 @@
|
|||
| i_imports.py:18 | ControlFlowNode for sys | Module sys | builtin-class module | 17 |
|
||||
| i_imports.py:23 | ControlFlowNode for ImportExpr | Module code | builtin-class module | 23 |
|
||||
| i_imports.py:23 | ControlFlowNode for code | Module code | builtin-class module | 23 |
|
||||
| i_imports.py:24 | ControlFlowNode for Attribute | Module code.package | builtin-class module | 0 |
|
||||
| i_imports.py:24 | ControlFlowNode for Attribute | Module code.package.x | builtin-class module | 0 |
|
||||
| i_imports.py:24 | ControlFlowNode for code | Module code | builtin-class module | 23 |
|
||||
| i_imports.py:27 | ControlFlowNode for ImportExpr | Module code.test_package | builtin-class module | 27 |
|
||||
|
|
|
@ -95,9 +95,11 @@ predicate ssa_sanity(string clsname, string problem, string what) {
|
|||
not exists(m.getName()) and
|
||||
problem = "does not have a name"
|
||||
or
|
||||
not m.isPackage() and
|
||||
not exists(Variable v | v.getId() = "__name__" and v.getScope() = m) and
|
||||
problem = "does not have a __name__ variable"
|
||||
or
|
||||
not m.isPackage() and
|
||||
not exists(PyNodeDefinition def |
|
||||
def.getDefiningNode().getScope() = m and
|
||||
def.getVariable().getName() = "__name__"
|
||||
|
|
Загрузка…
Ссылка в новой задаче