Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit df3cc38

Browse files
committed
minor improvements
1 parent 4c13e0e commit df3cc38

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

lib/core/testing.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -169,14 +169,16 @@ def liveTest():
169169
msg = "running live test case: %s (%d/%d)" % (name, count, length)
170170
logger.info(msg)
171171

172-
try:
173-
result = runCase(switches, parse)
174-
except SqlmapNotVulnerableException:
175-
vulnerable = False
172+
initCase(switches)
176173

177174
test_case_fd = codecs.open(os.path.join(paths.SQLMAP_OUTPUT_PATH, "test_case"), "wb", UNICODE_ENCODING)
178175
test_case_fd.write("%s\n" % name)
179176

177+
try:
178+
result = runCase(parse)
179+
except SqlmapNotVulnerableException:
180+
vulnerable = False
181+
180182
if result is True:
181183
logger.info("test passed")
182184
cleanCase()
@@ -250,13 +252,11 @@ def initCase(switches=None):
250252
def cleanCase():
251253
shutil.rmtree(paths.SQLMAP_OUTPUT_PATH, True)
252254

253-
def runCase(switches=None, parse=None):
255+
def runCase(parse):
254256
global failedItem
255257
global failedParseOn
256258
global failedTraceBack
257259

258-
initCase(switches)
259-
260260
LOGGER_HANDLER.stream = sys.stdout = tempfile.SpooledTemporaryFile(max_size=0, mode="w+b", prefix="sqlmapstdout-")
261261
retVal = True
262262
handled_exception = None

0 commit comments

Comments
 (0)