Skip to content

Commit bc50e90

Browse files
committed
Python: Use mock for tornado tests
1 parent 4248a84 commit bc50e90

8 files changed

Lines changed: 3 additions & 123 deletions

File tree

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
| class ErrorHandler | resources/lib/python/lib/tornado/web.py:2260 |
2-
| class FallbackHandler | resources/lib/python/lib/tornado/web.py:2806 |
31
| class Handler1 | test.py:4 |
42
| class Handler2 | test.py:8 |
53
| class Handler3 | test.py:14 |
6-
| class RedirectHandler | resources/lib/python/lib/tornado/web.py:2275 |
7-
| class StaticFileHandler | resources/lib/python/lib/tornado/web.py:2319 |
Lines changed: 0 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +0,0 @@
1-
| __init__ | Function __init__ | resources/lib/python/lib/tornado/web.py:168 |
2-
| _break_cycles | Function _break_cycles | resources/lib/python/lib/tornado/web.py:1025 |
3-
| _clear_headers_for_304 | Function _clear_headers_for_304 | resources/lib/python/lib/tornado/web.py:1636 |
4-
| _convert_header_value | Function _convert_header_value | resources/lib/python/lib/tornado/web.py:363 |
5-
| _decode_xsrf_token | Function _decode_xsrf_token | resources/lib/python/lib/tornado/web.py:1294 |
6-
| _get_argument | Function _get_argument | resources/lib/python/lib/tornado/web.py:479 |
7-
| _get_arguments | Function _get_arguments | resources/lib/python/lib/tornado/web.py:487 |
8-
| _get_raw_xsrf_token | Function _get_raw_xsrf_token | resources/lib/python/lib/tornado/web.py:1270 |
9-
| _handle_request_exception | Function _handle_request_exception | resources/lib/python/lib/tornado/web.py:1581 |
10-
| _log | Function _log | resources/lib/python/lib/tornado/web.py:1568 |
11-
| _request_summary | Function _request_summary | resources/lib/python/lib/tornado/web.py:1577 |
12-
| _stack_context_handle_exception | Function _stack_context_handle_exception | resources/lib/python/lib/tornado/web.py:1493 |
13-
| _ui_method | Function _ui_method | resources/lib/python/lib/tornado/web.py:1633 |
14-
| _ui_module | Function _ui_module | resources/lib/python/lib/tornado/web.py:1623 |
15-
| add_header | Function add_header | resources/lib/python/lib/tornado/web.py:343 |
16-
| check_etag_header | Function check_etag_header | resources/lib/python/lib/tornado/web.py:1452 |
17-
| check_xsrf_cookie | Function check_xsrf_cookie | resources/lib/python/lib/tornado/web.py:1330 |
18-
| clear | Function clear | resources/lib/python/lib/tornado/web.py:288 |
19-
| clear_all_cookies | Function clear_all_cookies | resources/lib/python/lib/tornado/web.py:597 |
20-
| clear_cookie | Function clear_cookie | resources/lib/python/lib/tornado/web.py:582 |
21-
| clear_header | Function clear_header | resources/lib/python/lib/tornado/web.py:352 |
22-
| compute_etag | Function compute_etag | resources/lib/python/lib/tornado/web.py:1428 |
23-
| create_signed_value | Function create_signed_value | resources/lib/python/lib/tornado/web.py:642 |
24-
| create_template_loader | Function create_template_loader | resources/lib/python/lib/tornado/web.py:916 |
25-
| data_received | Function data_received | resources/lib/python/lib/tornado/web.py:1561 |
26-
| decode_argument | Function decode_argument | resources/lib/python/lib/tornado/web.py:500 |
27-
| delete | Function delete | resources/lib/python/lib/tornado/web.py:230 |
28-
| finish | Function finish | resources/lib/python/lib/tornado/web.py:985 |
29-
| flush | Function flush | resources/lib/python/lib/tornado/web.py:937 |
30-
| get | Function get | resources/lib/python/lib/tornado/web.py:224 |
31-
| get_argument | Function get_argument | resources/lib/python/lib/tornado/web.py:395 |
32-
| get_arguments | Function get_arguments | resources/lib/python/lib/tornado/web.py:408 |
33-
| get_body_argument | Function get_body_argument | resources/lib/python/lib/tornado/web.py:423 |
34-
| get_body_arguments | Function get_body_arguments | resources/lib/python/lib/tornado/web.py:440 |
35-
| get_browser_locale | Function get_browser_locale | resources/lib/python/lib/tornado/web.py:1127 |
36-
| get_cookie | Function get_cookie | resources/lib/python/lib/tornado/web.py:525 |
37-
| get_current_user | Function get_current_user | resources/lib/python/lib/tornado/web.py:1191 |
38-
| get_login_url | Function get_login_url | resources/lib/python/lib/tornado/web.py:1198 |
39-
| get_query_argument | Function get_query_argument | resources/lib/python/lib/tornado/web.py:451 |
40-
| get_query_arguments | Function get_query_arguments | resources/lib/python/lib/tornado/web.py:468 |
41-
| get_secure_cookie | Function get_secure_cookie | resources/lib/python/lib/tornado/web.py:665 |
42-
| get_secure_cookie_key_version | Function get_secure_cookie_key_version | resources/lib/python/lib/tornado/web.py:688 |
43-
| get_status | Function get_status | resources/lib/python/lib/tornado/web.py:329 |
44-
| get_template_namespace | Function get_template_namespace | resources/lib/python/lib/tornado/web.py:893 |
45-
| get_template_path | Function get_template_path | resources/lib/python/lib/tornado/web.py:1206 |
46-
| get_user_locale | Function get_user_locale | resources/lib/python/lib/tornado/web.py:1117 |
47-
| head | Function head | resources/lib/python/lib/tornado/web.py:221 |
48-
| initialize | Function initialize | resources/lib/python/lib/tornado/web.py:195 |
49-
| log_exception | Function log_exception | resources/lib/python/lib/tornado/web.py:1603 |
50-
| on_connection_close | Function on_connection_close | resources/lib/python/lib/tornado/web.py:269 |
51-
| on_finish | Function on_finish | resources/lib/python/lib/tornado/web.py:259 |
52-
| options | Function options | resources/lib/python/lib/tornado/web.py:239 |
53-
| patch | Function patch | resources/lib/python/lib/tornado/web.py:233 |
54-
| post | Function post | resources/lib/python/lib/tornado/web.py:227 |
55-
| prepare | Function prepare | resources/lib/python/lib/tornado/web.py:242 |
56-
| put | Function put | resources/lib/python/lib/tornado/web.py:236 |
57-
| redirect | Function redirect | resources/lib/python/lib/tornado/web.py:698 |
58-
| render | Function render | resources/lib/python/lib/tornado/web.py:746 |
59-
| render_embed_css | Function render_embed_css | resources/lib/python/lib/tornado/web.py:859 |
60-
| render_embed_js | Function render_embed_js | resources/lib/python/lib/tornado/web.py:830 |
61-
| render_linked_css | Function render_linked_css | resources/lib/python/lib/tornado/web.py:839 |
62-
| render_linked_js | Function render_linked_js | resources/lib/python/lib/tornado/web.py:810 |
63-
| render_string | Function render_string | resources/lib/python/lib/tornado/web.py:868 |
64-
| require_setting | Function require_setting | resources/lib/python/lib/tornado/web.py:1418 |
65-
| reverse_url | Function reverse_url | resources/lib/python/lib/tornado/web.py:1424 |
66-
| send_error | Function send_error | resources/lib/python/lib/tornado/web.py:1030 |
67-
| set_cookie | Function set_cookie | resources/lib/python/lib/tornado/web.py:538 |
68-
| set_default_headers | Function set_default_headers | resources/lib/python/lib/tornado/web.py:300 |
69-
| set_etag_header | Function set_etag_header | resources/lib/python/lib/tornado/web.py:1441 |
70-
| set_header | Function set_header | resources/lib/python/lib/tornado/web.py:333 |
71-
| set_secure_cookie | Function set_secure_cookie | resources/lib/python/lib/tornado/web.py:613 |
72-
| set_status | Function set_status | resources/lib/python/lib/tornado/web.py:310 |
73-
| static_url | Function static_url | resources/lib/python/lib/tornado/web.py:1383 |
74-
| write | Function write | resources/lib/python/lib/tornado/web.py:716 |
75-
| write_error | Function write_error | resources/lib/python/lib/tornado/web.py:1069 |
76-
| xsrf_form_html | Function xsrf_form_html | resources/lib/python/lib/tornado/web.py:1367 |
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
| resources/lib/python/lib/tornado/web.py:2316 | to_url | externally controlled string |
2-
| resources/lib/python/lib/tornado/web.py:2471 | chunk | externally controlled string |
3-
| resources/lib/python/lib/tornado/web.py:2597 | BinaryExpr | externally controlled string |
41
| test.py:6 | Attribute() | externally controlled string |
52
| test.py:12 | name | externally controlled string |
63
| test.py:20 | url | externally controlled string |
Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,3 @@
1-
| resources/lib/python/lib/tornado/web.py:406 | Attribute | tornado.request.HttpRequest |
2-
| resources/lib/python/lib/tornado/web.py:449 | Attribute | tornado.request.HttpRequest |
3-
| resources/lib/python/lib/tornado/web.py:2313 | Attribute | tornado.request.HttpRequest |
4-
| resources/lib/python/lib/tornado/web.py:2315 | Attribute | tornado.request.HttpRequest |
5-
| resources/lib/python/lib/tornado/web.py:2421 | Attribute | tornado.request.HttpRequest |
6-
| resources/lib/python/lib/tornado/web.py:2476 | Attribute | tornado.request.HttpRequest |
7-
| resources/lib/python/lib/tornado/web.py:2522 | Attribute | tornado.request.HttpRequest |
8-
| resources/lib/python/lib/tornado/web.py:2527 | Attribute | tornado.request.HttpRequest |
9-
| resources/lib/python/lib/tornado/web.py:2596 | Attribute | tornado.request.HttpRequest |
10-
| resources/lib/python/lib/tornado/web.py:2597 | Attribute | tornado.request.HttpRequest |
11-
| resources/lib/python/lib/tornado/web.py:2728 | Attribute | tornado.request.HttpRequest |
12-
| resources/lib/python/lib/tornado/web.py:2826 | Attribute | tornado.request.HttpRequest |
131
| test.py:6 | Attribute() | externally controlled string |
142
| test.py:10 | Attribute() | [externally controlled string] |
153
| test.py:17 | Attribute | tornado.request.HttpRequest |

python/ql/test/library-tests/web/tornado/Taint.expected

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,3 @@
1-
| resources/lib/python/lib/tornado/web.py:406 | Attribute | tornado.request.HttpRequest |
2-
| resources/lib/python/lib/tornado/web.py:406 | Attribute | {[externally controlled string]} |
3-
| resources/lib/python/lib/tornado/web.py:449 | Attribute | tornado.request.HttpRequest |
4-
| resources/lib/python/lib/tornado/web.py:449 | Attribute | {[externally controlled string]} |
5-
| resources/lib/python/lib/tornado/web.py:2313 | Attribute | tornado.request.HttpRequest |
6-
| resources/lib/python/lib/tornado/web.py:2313 | Attribute | {[externally controlled string]} |
7-
| resources/lib/python/lib/tornado/web.py:2315 | Attribute | tornado.request.HttpRequest |
8-
| resources/lib/python/lib/tornado/web.py:2315 | Attribute | {[externally controlled string]} |
9-
| resources/lib/python/lib/tornado/web.py:2421 | Attribute | tornado.request.HttpRequest |
10-
| resources/lib/python/lib/tornado/web.py:2421 | Attribute | {externally controlled string} |
11-
| resources/lib/python/lib/tornado/web.py:2421 | Attribute() | externally controlled string |
12-
| resources/lib/python/lib/tornado/web.py:2422 | range_header | externally controlled string |
13-
| resources/lib/python/lib/tornado/web.py:2425 | range_header | externally controlled string |
14-
| resources/lib/python/lib/tornado/web.py:2476 | Attribute | tornado.request.HttpRequest |
15-
| resources/lib/python/lib/tornado/web.py:2522 | Attribute | tornado.request.HttpRequest |
16-
| resources/lib/python/lib/tornado/web.py:2522 | Attribute | {externally controlled string} |
17-
| resources/lib/python/lib/tornado/web.py:2522 | Attribute() | externally controlled string |
18-
| resources/lib/python/lib/tornado/web.py:2527 | Attribute | tornado.request.HttpRequest |
19-
| resources/lib/python/lib/tornado/web.py:2527 | Attribute | {externally controlled string} |
20-
| resources/lib/python/lib/tornado/web.py:2527 | Attribute() | externally controlled string |
21-
| resources/lib/python/lib/tornado/web.py:2528 | ims_value | externally controlled string |
22-
| resources/lib/python/lib/tornado/web.py:2529 | ims_value | externally controlled string |
23-
| resources/lib/python/lib/tornado/web.py:2596 | Attribute | tornado.request.HttpRequest |
24-
| resources/lib/python/lib/tornado/web.py:2597 | Attribute | tornado.request.HttpRequest |
25-
| resources/lib/python/lib/tornado/web.py:2728 | Attribute | tornado.request.HttpRequest |
26-
| resources/lib/python/lib/tornado/web.py:2728 | Attribute | {[externally controlled string]} |
27-
| resources/lib/python/lib/tornado/web.py:2826 | Attribute | tornado.request.HttpRequest |
281
| test.py:6 | Attribute() | externally controlled string |
292
| test.py:10 | Attribute() | [externally controlled string] |
303
| test.py:11 | Subscript | externally controlled string |
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=2 -p ../../../../../../../resources/lib/python/lib/
1+
semmle-extractor-options: --max-import-depth=2 -p ../../../query-tests/Security/lib/
22
optimize: true

python/ql/test/query-tests/Security/lib/tornado/__init__.py

Whitespace-only changes.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
class RequestHandler(object):
2+
pass

0 commit comments

Comments
 (0)