tests: exit 1 if tests fail
This commit is contained in:
@@ -81,7 +81,7 @@ def checkRegex(regex, should_work=True, upper=False):
|
|||||||
if server.sendCheckData(secrets.token_bytes(200) + base64.b64decode(regex) + secrets.token_bytes(200)):
|
if server.sendCheckData(secrets.token_bytes(200) + base64.b64decode(regex) + secrets.token_bytes(200)):
|
||||||
puts(f"The request wasn't blocked ✔", color=colors.green)
|
puts(f"The request wasn't blocked ✔", color=colors.green)
|
||||||
else:
|
else:
|
||||||
puts(f"Test Failed: The request was blocked when it shouldn't have", color=colors.red)
|
puts(f"Test Failed: The request was blocked when it shouldn't have", color=colors.red); exit_test(1)
|
||||||
|
|
||||||
checkRegex(regex)
|
checkRegex(regex)
|
||||||
|
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ def checkRegex(regex, should_work=True, upper=False):
|
|||||||
if server.sendCheckData(secrets.token_bytes(200) + base64.b64decode(regex) + secrets.token_bytes(200)):
|
if server.sendCheckData(secrets.token_bytes(200) + base64.b64decode(regex) + secrets.token_bytes(200)):
|
||||||
puts(f"The request wasn't blocked ✔", color=colors.green)
|
puts(f"The request wasn't blocked ✔", color=colors.green)
|
||||||
else:
|
else:
|
||||||
puts(f"Test Failed: The request was blocked when it shouldn't have", color=colors.red)
|
puts(f"Test Failed: The request was blocked when it shouldn't have", color=colors.red); exit_test(1)
|
||||||
|
|
||||||
checkRegex(regex)
|
checkRegex(regex)
|
||||||
|
|
||||||
|
|||||||
0
tests/run_tests.sh
Executable file → Normal file
0
tests/run_tests.sh
Executable file → Normal file
Reference in New Issue
Block a user