File tree Expand file tree Collapse file tree 1 file changed +2
-18
lines changed
aikido_zen/vulnerabilities/sql_injection Expand file tree Collapse file tree 1 file changed +2
-18
lines changed Original file line number Diff line number Diff line change 11import pytest
2- from aikido_zen .context import Context
32from .context_contains_sql_injection import context_contains_sql_injection
4-
5-
6- class Context2 (Context ):
7- def __init__ (self ):
8- self .cookies = {}
9- self .headers = {}
10- self .remote_address = "ip"
11- self .method = "POST"
12- self .url = "url"
13- self .body = {}
14- self .query = {
15- "domain" : "www.example`whoami`.com" ,
16- }
17- self .source = "express"
18- self .route = "/"
19- self .parsed_userinput = {}
3+ import aikido_zen .test_utils as test_utils
204
215
226@pytest .mark .parametrize (
@@ -38,7 +22,7 @@ def __init__(self):
3822 ],
3923)
4024def test_doesnt_crash_with_invalid_sql (invalid_input ):
41- context = Context2 ( )
25+ context = test_utils . generate_context ( value = invalid_input )
4226 result = context_contains_sql_injection (
4327 sql = invalid_input ,
4428 operation = "mysqlclient.query" ,
You can’t perform that action at this time.
0 commit comments