Unit tests, extract init_args from main, add option to README

This commit is contained in:
Anton Ermak
2018-01-09 15:59:58 +07:00
parent 5ba255f635
commit 2b754d2662
5 changed files with 54 additions and 11 deletions

View 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