Test now passes

This commit is contained in:
Kkevsterrr 2020-02-16 22:50:24 -05:00
parent d3cd636157
commit 502900e3e5
1 changed files with 6 additions and 7 deletions

View File

@ -1,5 +1,6 @@
import logging
from scapy.all import IP, TCP from scapy.all import IP, TCP
import evolve
import actions.utils import actions.utils
import actions.strategy import actions.strategy
import actions.packet import actions.packet
@ -9,12 +10,11 @@ import sys
sys.path.append("..") sys.path.append("..")
def test_basic_sleep(log_level): def test_basic_sleep():
""" """
Tests the sleep action primitive Tests the sleep action primitive
""" """
logger = evolve.logger logger = logging.getLogger("test")
evolve.set_logger(log_level)
sleep = actions.sleep.SleepAction(.5) sleep = actions.sleep.SleepAction(.5)
assert str(sleep) == "sleep{0.5}", "Sleep returned incorrect string representation: %s" % str(sleep) assert str(sleep) == "sleep{0.5}", "Sleep returned incorrect string representation: %s" % str(sleep)
@ -24,12 +24,11 @@ def test_basic_sleep(log_level):
assert packet1.sleep == .5, "Packet had wrong sleep value" assert packet1.sleep == .5, "Packet had wrong sleep value"
def test_sleep_str_parse(log_level): def test_sleep_str_parse():
""" """
Tests stringing and parsing a sleep action with a float sleep time Tests stringing and parsing a sleep action with a float sleep time
""" """
logger = evolve.logger logger = logging.getLogger("test")
evolve.set_logger(log_level)
strat = actions.utils.parse("[TCP:flags:A]-sleep{0.5}-|", logger) strat = actions.utils.parse("[TCP:flags:A]-sleep{0.5}-|", logger)