Skip to content

Commit de45b1a

Browse files
authored
Merge pull request #2767 from RasmusWL/python-six-tests
Python: Update expected six results
2 parents 78380f5 + cb891a1 commit de45b1a

File tree

12 files changed

+37
-578
lines changed

12 files changed

+37
-578
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
semmle-extractor-options: --lang=2 --max-import-depth=3
1+
semmle-extractor-options: --lang=2 --max-import-depth=4
22
optimize: true
Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1-
| six | Module six |
2-
| six.moves | Module six.moves |
1+
| six | Package six |
2+
| six.moves | Package six.moves |
3+
| six.moves.http_client | Module httplib |
4+
| six.moves.http_client.HTTPConnection | class HTTPConnection |
35
| six.moves.range | builtin-class xrange |
6+
| six.moves.urllib | Package six.moves.urllib |
7+
| six.moves.urllib.parse | Module six.moves.urllib_parse |
8+
| six.moves.urllib.parse.urlsplit | Function urlsplit |
9+
| six.moves.zip | builtin-class itertools.izip |
Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
1-
21
import python
32

43
string longname(Expr e) {
54
result = e.(Name).getId()
65
or
7-
exists(Attribute a |
8-
a = e |
9-
result = longname(a.getObject()) + "." + a.getName()
10-
)
6+
exists(Attribute a | a = e | result = longname(a.getObject()) + "." + a.getName())
117
}
128

13-
from Expr e, Object o
14-
where e.refersTo(o) and e.getLocation().getFile().getShortName() = "test.py"
15-
select longname(e), o.toString()
9+
from Expr e, Value v
10+
where e.pointsTo(v) and e.getLocation().getFile().getShortName() = "test.py"
11+
select longname(e), v.toString()

python/ql/test/2/library-tests/six/test.expected

Lines changed: 0 additions & 268 deletions
This file was deleted.
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
import six
22

3-
#Check that some expected attributes are visible
3+
# Check that some expected attributes are visible -- this is the reason we added stubs in
4+
# the first place! If this works, we're happy!
45
six.moves
56
six.moves.range
7+
six.moves.zip
8+
six.moves.http_client.HTTPConnection
9+
six.moves.urllib.parse.urlsplit

python/ql/test/2/library-tests/six/test.ql

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
semmle-extractor-options: --max-import-depth=3
1+
semmle-extractor-options: --max-import-depth=4
22
optimize: true
Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1-
| six | Module six |
2-
| six.moves | Module six.moves |
1+
| six | Package six |
2+
| six.moves | Package six.moves |
3+
| six.moves.http_client | Module http.client |
4+
| six.moves.http_client.HTTPConnection | class HTTPConnection |
35
| six.moves.range | builtin-class range |
6+
| six.moves.urllib | Package six.moves.urllib |
7+
| six.moves.urllib.parse | Module six.moves.urllib_parse |
8+
| six.moves.urllib.parse.urlsplit | Function urlsplit |
9+
| six.moves.zip | builtin-class zip |
Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
1-
21
import python
32

43
string longname(Expr e) {
54
result = e.(Name).getId()
65
or
7-
exists(Attribute a |
8-
a = e |
9-
result = longname(a.getObject()) + "." + a.getName()
10-
)
6+
exists(Attribute a | a = e | result = longname(a.getObject()) + "." + a.getName())
117
}
128

13-
from Expr e, Object o
14-
where e.refersTo(o) and e.getLocation().getFile().getShortName() = "test.py"
15-
select longname(e), o.toString()
16-
9+
from Expr e, Value v
10+
where e.pointsTo(v) and e.getLocation().getFile().getShortName() = "test.py"
11+
select longname(e), v.toString()

0 commit comments

Comments
 (0)