Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def create_backtesting_bot(config):
bot = OctoBot(config)
return bot
def test_create_bot():
# launch a bot
config = load_test_config()
bot = OctoBot(config)
bot.stop_threads()
def test_run_bot():
# launch a bot
config = load_test_config()
bot = OctoBot(config)
bot.time_frames = [TimeFrames.ONE_MINUTE]
bot.create_exchange_traders()
bot.create_evaluation_threads()
bot.start_threads()
# let it run 2 minutes: test will fail if an exception is raised
# 1.9 to stop threads before the next time frame
time.sleep(1.9 * 60)
# stop the bot
bot.stop_threads()