Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
xmendez committed Nov 2, 2020
1 parent 5dafaa5 commit 768c048
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 25 deletions.
34 changes: 30 additions & 4 deletions tests/acceptance/test_saved_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,38 @@ def get_temp_file():
def test_filter_prev_payload():

filename = get_temp_file()
for res in wfuzz.get_session("-z range --zD 0-0 -H test:1 -u http://localhost:9000/anything/FUZZ").fuzz(save=filename):
for res in wfuzz.get_session(
"-z range --zD 0-0 -H test:1 -u http://localhost:9000/anything/FUZZ"
).fuzz(save=filename):
pass

filename_new = get_temp_file()
for res in wfuzz.get_session("-z wfuzzp --zD {} -u FUZZ -H test:2 --oF {}".format(filename, filename_new)).fuzz(save=filename_new):
for res in wfuzz.get_session(
"-z wfuzzp --zD {} -u FUZZ -H test:2 --oF {}".format(filename, filename_new)
).fuzz(save=filename_new):
pass

assert len(list(wfuzz.get_session("-z wfuzzp --zD {} --slice r.headers.request.test=2 --dry-run -u FUZZ".format(filename_new)).fuzz())) == 1
assert len(list(wfuzz.get_session("-z wfuzzp --zD {} --slice FUZZ[r.headers.request.test]=1 --dry-run -u FUZZ".format(filename_new)).fuzz())) == 1
assert (
len(
list(
wfuzz.get_session(
"-z wfuzzp --zD {} --slice r.headers.request.test=2 --dry-run -u FUZZ".format(
filename_new
)
).fuzz()
)
)
== 1
)
assert (
len(
list(
wfuzz.get_session(
"-z wfuzzp --zD {} --slice FUZZ[r.headers.request.test]=1 --dry-run -u FUZZ".format(
filename_new
)
).fuzz()
)
)
== 1
)
41 changes: 20 additions & 21 deletions tests/plugins/test_burplog.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def readline(self, *args, **kwargs):
"HTTP/1.1 200 OK\n"
"Server: nginx/1.17.9\n"
"\n"
"<?xml version=\"1.0\"?>\n"
'<?xml version="1.0"?>\n'
"<updates>\n"
"</updates> \n"
"======================================================\n"
Expand All @@ -104,7 +104,7 @@ def readline(self, *args, **kwargs):
"HTTP/1.1 200 OK\n"
"Server: nginx/1.17.9\n"
"\n"
"<?xml version=\"1.0\"?>\n"
'<?xml version="1.0"?>\n'
"<updates>\n"
"</updates>\n"
"\n"
Expand All @@ -128,7 +128,7 @@ def readline(self, *args, **kwargs):
"HTTP/1.1 200 OK\n"
"Server: nginx/1.17.9\n"
"\n"
"<?xml version=\"1.0\"?>\n"
'<?xml version="1.0"?>\n'
"<updates>\n"
"</updates>\n"
"======================================================\n"
Expand All @@ -153,15 +153,15 @@ def readline(self, *args, **kwargs):
"Date: Mon, 19 Jan 1970 15:36:40 GMT\n"
"Last-Modified: Wed, 11 May 2011 10:27:48 GMT\n"
"Connection: close\n"
"ETag: \"4dca64a4-156a\"\n"
'ETag: "4dca64a4-156a"\n'
"\n"
"\n"
"======================================================\n"
"\n"
"\n"
"\n"
),
'',
"",
),
],
indirect=["burplog_file"],
Expand Down Expand Up @@ -225,7 +225,7 @@ def test_burplog_content(burplog_file, expected_content):
"Alt-Svc: clear\n"
"Connection: close\n"
"\n"
"<?xml version=\"1.0\"?>\n"
'<?xml version="1.0"?>\n'
"<updates>\n"
"</updates>\n"
"======================================================\n"
Expand All @@ -244,21 +244,20 @@ def test_burplog_content(burplog_file, expected_content):
"Connection": "close",
},
{
'Server': 'nginx/1.17.9',
'Date': 'Sun, 01 Nov 2020 21:35:08 GMT',
'Content-Type': 'text/xml; charset=utf-8',
'Content-Length': '42',
'Strict-Transport-Security': 'max-age=31536000;',
'X-Content-Type-Options': 'nosniff',
'Content-Security-Policy': "default-src 'none'; frame-ancestors 'none'",
'X-Proxy-Cache-Status': 'EXPIRED',
'Via': '1.1 google',
'Age': '47',
'Cache-Control': 'public, max-age=90',
'Alt-Svc': 'clear',
'Connection': 'close',
}
"Server": "nginx/1.17.9",
"Date": "Sun, 01 Nov 2020 21:35:08 GMT",
"Content-Type": "text/xml; charset=utf-8",
"Content-Length": "42",
"Strict-Transport-Security": "max-age=31536000;",
"X-Content-Type-Options": "nosniff",
"Content-Security-Policy": "default-src 'none'; frame-ancestors 'none'",
"X-Proxy-Cache-Status": "EXPIRED",
"Via": "1.1 google",
"Age": "47",
"Cache-Control": "public, max-age=90",
"Alt-Svc": "clear",
"Connection": "close",
},
),
],
indirect=["burplog_file"],
Expand Down

0 comments on commit 768c048

Please sign in to comment.