Skip to content

Commit 3716b8c

Browse files
committed
Python: update test to reflect correct behaviour
also add comments
1 parent 9f7edf3 commit 3716b8c

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

python/ql/test/library-tests/dataflow/model-summaries/model_summaries.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,13 +129,16 @@ def explicit_identity(x):
129129
SINK_F(a)
130130
SINK(b) # $ flow="SOURCE, l:-2 -> b"
131131

132-
# call the instance method on the class to expose the self argument
132+
# Call the instance method on the class to expose the self argument
133133
x, y = MS_Class.instance_method(SOURCE, NONSOURCE)
134134
SINK(x) # $ MISSING: flow="SOURCE, l:-1 -> x"
135135
SINK_F(y)
136136

137-
# call the instance method on the class to expose the self argument
138-
SINK(MS_Class.explicit_self(SOURCE)) # $ MISSING: flow="SOURCE, l:0 -> ms(SOURCE)"
137+
# Call the instance method on the class to expose the self argument
138+
# That self argument is not referenced by `Argument[self:]`
139+
SINK_F(MS_Class.explicit_self(SOURCE))
140+
# Instead, `Argument[self:]` refers to a keyword argument named `self` (which you are allowed to do in Python)
141+
SINK(c.explicit_self(self = SOURCE)) # $ flow="SOURCE -> c.explicit_self(..)"
139142

140143
# Modeled flow-summary is not value preserving
141144
from json import MS_loads as json_loads

0 commit comments

Comments
 (0)