More engine tests

This commit is contained in:
Kkevsterrr 2019-12-12 23:01:06 -05:00
parent fab15ae53f
commit 6e4f11c972
2 changed files with 30 additions and 0 deletions

View File

@ -9,6 +9,7 @@ exclude_lines =
raise NotImplementedError
if __name__ == .__main__.:
def get_args
def main
ignore_errors = True
omit =
tests/*

View File

@ -19,3 +19,32 @@ def test_engine():
# Create the engine in debug mode
with engine.Engine(port, strategy, log_level="debug") as eng:
os.system("curl http://example.com?q=ultrasurf")
def test_engine_sleep():
"""
Basic engine test with sleep action
"""
# Port to run the engine on
port = 80
# Strategy to use
strategy = "[TCP:flags:S]-sleep{1}-|"
# Create the engine in debug mode
with engine.Engine(port, strategy, log_level="info") as eng:
os.system("curl http://example.com?q=ultrasurf")
def test_engine_trace():
"""
Basic engine test with trace
"""
# Port to run the engine on
port = 80
# Strategy to use
strategy = "[TCP:flags:PA]-trace{2:10}-|"
# Create the engine in debug mode
with engine.Engine(port, strategy, log_level="debug") as eng:
os.system("curl -m 5 http://example.com?q=ultrasurf")