Skip to content

Commit b213db0

Browse files
committed
Python: Consolidate stdlib http client tests
Move the stdlib tests from test/{2,3}/library-tests/ into /test/library-tests/, and deal with version by using sys.version_info (results should be the same for both versions). six tests were moved from /library-tests/web/client/stdlib => /library-tests/web/client/six
1 parent be187bc commit b213db0

File tree

11 files changed

+33
-82
lines changed

11 files changed

+33
-82
lines changed

python/ql/test/2/library-tests/web/client/stdlib/ClientHttpRequests.expected

Lines changed: 0 additions & 10 deletions
This file was deleted.

python/ql/test/2/library-tests/web/client/stdlib/test.py

Lines changed: 0 additions & 37 deletions
This file was deleted.

python/ql/test/3/library-tests/web/client/stdlib/ClientHttpRequests.expected

Lines changed: 0 additions & 10 deletions
This file was deleted.

python/ql/test/3/library-tests/web/client/stdlib/ClientHttpRequests.ql

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
| test.py:7:5:7:32 | ControlFlowNode for Attribute() | test.py:6:27:6:39 | ControlFlowNode for Str | GET |
2+
| test.py:7:5:7:32 | ControlFlowNode for Attribute() | test.py:7:25:7:31 | ControlFlowNode for Str | GET |
3+
| test.py:16:5:16:33 | ControlFlowNode for Attribute() | test.py:11:28:11:40 | ControlFlowNode for Str | POST |
4+
| test.py:16:5:16:33 | ControlFlowNode for Attribute() | test.py:16:26:16:32 | ControlFlowNode for Str | POST |
5+
| test.py:21:5:21:33 | ControlFlowNode for Attribute() | test.py:20:27:20:39 | ControlFlowNode for Str | <NO METHOD> |
6+
| test.py:21:5:21:33 | ControlFlowNode for Attribute() | test.py:21:26:21:32 | ControlFlowNode for Str | <NO METHOD> |
7+
| test.py:31:5:31:32 | ControlFlowNode for Attribute() | test.py:29:27:29:30 | ControlFlowNode for fake | GET |
8+
| test.py:31:5:31:32 | ControlFlowNode for Attribute() | test.py:31:25:31:31 | ControlFlowNode for Str | GET |
9+
| test.py:38:5:38:29 | ControlFlowNode for req_meth() | test.py:36:27:36:39 | ControlFlowNode for Str | HEAD |
10+
| test.py:38:5:38:29 | ControlFlowNode for req_meth() | test.py:38:22:38:28 | ControlFlowNode for Str | HEAD |
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
semmle-extractor-options: --max-import-depth=2
2+
optimize: true

python/ql/test/3/library-tests/web/client/stdlib/test.py renamed to python/ql/test/library-tests/web/client/six/test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
from http.client import HTTPConnection, HTTPSConnection
1+
from six.moves.http_client import HTTPConnection, HTTPSConnection
2+
from six.moves.urllib.parse import urlsplit
23

34

45
def basic():
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
| test.py:7:5:7:32 | ControlFlowNode for Attribute() | test.py:6:27:6:39 | ControlFlowNode for Str | GET |
2-
| test.py:7:5:7:32 | ControlFlowNode for Attribute() | test.py:7:25:7:31 | ControlFlowNode for Str | GET |
3-
| test.py:16:5:16:33 | ControlFlowNode for Attribute() | test.py:11:28:11:40 | ControlFlowNode for Str | POST |
4-
| test.py:16:5:16:33 | ControlFlowNode for Attribute() | test.py:16:26:16:32 | ControlFlowNode for Str | POST |
5-
| test.py:21:5:21:33 | ControlFlowNode for Attribute() | test.py:20:27:20:39 | ControlFlowNode for Str | <NO METHOD> |
6-
| test.py:21:5:21:33 | ControlFlowNode for Attribute() | test.py:21:26:21:32 | ControlFlowNode for Str | <NO METHOD> |
7-
| test.py:31:5:31:32 | ControlFlowNode for Attribute() | test.py:29:27:29:30 | ControlFlowNode for fake | GET |
8-
| test.py:31:5:31:32 | ControlFlowNode for Attribute() | test.py:31:25:31:31 | ControlFlowNode for Str | GET |
9-
| test.py:38:5:38:29 | ControlFlowNode for req_meth() | test.py:36:27:36:39 | ControlFlowNode for Str | HEAD |
10-
| test.py:38:5:38:29 | ControlFlowNode for req_meth() | test.py:38:22:38:28 | ControlFlowNode for Str | HEAD |
1+
| test.py:13:5:13:32 | ControlFlowNode for Attribute() | test.py:12:27:12:39 | ControlFlowNode for Str | GET |
2+
| test.py:13:5:13:32 | ControlFlowNode for Attribute() | test.py:13:25:13:31 | ControlFlowNode for Str | GET |
3+
| test.py:22:5:22:33 | ControlFlowNode for Attribute() | test.py:17:28:17:40 | ControlFlowNode for Str | POST |
4+
| test.py:22:5:22:33 | ControlFlowNode for Attribute() | test.py:22:26:22:32 | ControlFlowNode for Str | POST |
5+
| test.py:27:5:27:33 | ControlFlowNode for Attribute() | test.py:26:27:26:39 | ControlFlowNode for Str | <NO METHOD> |
6+
| test.py:27:5:27:33 | ControlFlowNode for Attribute() | test.py:27:26:27:32 | ControlFlowNode for Str | <NO METHOD> |
7+
| test.py:37:5:37:32 | ControlFlowNode for Attribute() | test.py:35:27:35:30 | ControlFlowNode for fake | GET |
8+
| test.py:37:5:37:32 | ControlFlowNode for Attribute() | test.py:37:25:37:31 | ControlFlowNode for Str | GET |
9+
| test.py:44:5:44:29 | ControlFlowNode for req_meth() | test.py:42:27:42:39 | ControlFlowNode for Str | HEAD |
10+
| test.py:44:5:44:29 | ControlFlowNode for req_meth() | test.py:44:22:44:28 | ControlFlowNode for Str | HEAD |
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
semmle-extractor-options: --max-import-depth=2
1+
semmle-extractor-options: --max-import-depth=1

0 commit comments

Comments
 (0)