forked from p15670423/monkey
UT: Add tests for should_propagate
This commit is contained in:
parent
1199c72f0d
commit
eeba0e0616
|
@ -0,0 +1,32 @@
|
|||
from infection_monkey.utils.propagation import should_propagate
|
||||
|
||||
|
||||
def get_config(max_depth):
|
||||
return {"config": {"depth": max_depth}}
|
||||
|
||||
|
||||
def test_should_propagate_current_less_than_max():
|
||||
max_depth = 2
|
||||
current_depth = 1
|
||||
|
||||
config = get_config(max_depth)
|
||||
|
||||
assert should_propagate(config, current_depth) is True
|
||||
|
||||
|
||||
def test_should_propagate_current_greater_than_max():
|
||||
max_depth = 2
|
||||
current_depth = 3
|
||||
|
||||
config = get_config(max_depth)
|
||||
|
||||
assert should_propagate(config, current_depth) is False
|
||||
|
||||
|
||||
def test_should_propagate_current_equal_to_max():
|
||||
max_depth = 2
|
||||
current_depth = max_depth
|
||||
|
||||
config = get_config(max_depth)
|
||||
|
||||
assert should_propagate(config, current_depth) is False
|
Loading…
Reference in New Issue