Skip to content

Commit 488a7f4

Browse files
committed
Python: update test expectations
1 parent eab64f1 commit 488a7f4

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

python/ql/test/experimental/dataflow/coverage/classes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def staticmethod():
3737
# When an instance method object is called, the underlying function (__func__) is called, inserting the class instance (__self__) in front of the argument list. For instance, when C is a class which contains a definition for a function f(), and x is an instance of C, calling x.f(1) is equivalent to calling C.f(x, 1).
3838
SINK(c.method(SOURCE, C))
3939
SINK(C.method(c, SOURCE, C))
40-
SINK(func_obj(c, SOURCE, C))
40+
SINK(func_obj(c, SOURCE, C)) # Path not found
4141

4242

4343
# When an instance method object is created by retrieving a class method object from a class or instance, its __self__ attribute is the class itself, and its __func__ attribute is the function object underlying the class method.
@@ -46,7 +46,7 @@ def staticmethod():
4646
# When an instance method object is derived from a class method object, the “class instance” stored in __self__ will actually be the class itself, so that calling either x.f(1) or C.f(1) is equivalent to calling f(C,1) where f is the underlying function.
4747
SINK(c.classmethod(SOURCE))
4848
SINK(C.classmethod(SOURCE))
49-
SINK(c_func_obj(C, SOURCE))
49+
SINK(c_func_obj(C, SOURCE)) # Path not found
5050

5151
# Generator functions
5252
# A function or method which uses the yield statement (see section The yield statement) is called a generator function. Such a function, when called, always returns an iterator object which can be used to execute the body of the function: calling the iterator’s iterator.__next__() method will cause the function to execute until it provides a value using the yield statement. When the function executes a return statement or falls off the end, a StopIteration exception is raised and the iterator will have reached the end of the set of values to be returned.

python/ql/test/experimental/dataflow/coverage/dataflow.expected

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
| classes.py:2:10:2:17 | ControlFlowNode for Str | classes.py:14:6:14:17 | ControlFlowNode for f() |
2+
| classes.py:2:10:2:17 | ControlFlowNode for Str | classes.py:38:6:38:24 | ControlFlowNode for Attribute() |
3+
| classes.py:2:10:2:17 | ControlFlowNode for Str | classes.py:39:6:39:27 | ControlFlowNode for Attribute() |
4+
| classes.py:2:10:2:17 | ControlFlowNode for Str | classes.py:40:6:40:27 | ControlFlowNode for func_obj() |
5+
| classes.py:2:10:2:17 | ControlFlowNode for Str | classes.py:47:6:47:26 | ControlFlowNode for Attribute() |
6+
| classes.py:2:10:2:17 | ControlFlowNode for Str | classes.py:48:6:48:26 | ControlFlowNode for Attribute() |
7+
| classes.py:2:10:2:17 | ControlFlowNode for Str | classes.py:49:6:49:26 | ControlFlowNode for c_func_obj() |
8+
| classes.py:14:8:14:13 | ControlFlowNode for SOURCE | classes.py:14:6:14:17 | ControlFlowNode for f() |
9+
| classes.py:38:15:38:20 | ControlFlowNode for SOURCE | classes.py:38:6:38:24 | ControlFlowNode for Attribute() |
10+
| classes.py:39:18:39:23 | ControlFlowNode for SOURCE | classes.py:39:6:39:27 | ControlFlowNode for Attribute() |
11+
| classes.py:47:20:47:25 | ControlFlowNode for SOURCE | classes.py:47:6:47:26 | ControlFlowNode for Attribute() |
12+
| classes.py:48:20:48:25 | ControlFlowNode for SOURCE | classes.py:48:6:48:26 | ControlFlowNode for Attribute() |
113
| test.py:20:9:20:14 | ControlFlowNode for SOURCE | test.py:21:10:21:10 | ControlFlowNode for x |
214
| test.py:25:9:25:16 | ControlFlowNode for Str | test.py:26:10:26:10 | ControlFlowNode for x |
315
| test.py:29:9:29:17 | ControlFlowNode for Str | test.py:30:10:30:10 | ControlFlowNode for x |

0 commit comments

Comments
 (0)