Unit tests, extract init_args from main, add option to README
This commit is contained in:
18
freqtrade/tests/test_watchdog.py
Normal file
18
freqtrade/tests/test_watchdog.py
Normal file
@@ -0,0 +1,18 @@
|
||||
from freqtrade.watchdog import Watchdog
|
||||
|
||||
|
||||
def test_watchdog_timeout(caplog):
|
||||
watchdog = Watchdog(1)
|
||||
assert(watchdog.run(0) is False)
|
||||
log = ["Watchdog started", "Kill process due to timeout"]
|
||||
for line in log:
|
||||
assert line in caplog.text
|
||||
|
||||
|
||||
def test_watchdog_kill(caplog):
|
||||
watchdog = Watchdog(1)
|
||||
watchdog.exit_gracefully(1, 0)
|
||||
assert(watchdog.run(0) is False)
|
||||
log = ["Watchdog started", "Watchdog stopped"]
|
||||
for line in log:
|
||||
assert line in caplog.text
|
||||
Reference in New Issue
Block a user