File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
lib/semmle/python/frameworks
test/library-tests/frameworks/lxml Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -70,4 +70,19 @@ private module Lxml {
7070
7171 override string getName ( ) { result = "lxml.etree" }
7272 }
73+
74+ class XPathEvaluatorCall extends XPathExecution:: Range , DataFlow:: CallCfgNode {
75+ XPathEvaluatorCall ( ) {
76+ this =
77+ API:: moduleImport ( "lxml" )
78+ .getMember ( "etree" )
79+ .getMember ( "XPathEvaluator" )
80+ .getReturn ( )
81+ .getACall ( )
82+ }
83+
84+ override DataFlow:: Node getXPath ( ) { result = this .getArg ( 0 ) }
85+
86+ override string getName ( ) { result = "lxml.etree" }
87+ }
7388}
Original file line number Diff line number Diff line change @@ -18,4 +18,4 @@ def test_ETXpath_class():
1818def test_XPathEvaluator_class ():
1919 root = etree .XML ("<root><a>TEXT</a></root>" )
2020 search_root = etree .XPathEvaluator (root )
21- text = search_root ("path" )[0 ] # $ MISSING: getXPath="path"
21+ text = search_root ("path" )[0 ] # $ getXPath="path"
You can’t perform that action at this time.
0 commit comments