integrated BASE64 encoded strategy loading

This commit is contained in:
Gert Wohlgemuth
2018-07-05 14:30:24 -07:00
parent 2bb63ba33d
commit 8bbee4038b
2 changed files with 29 additions and 2 deletions

View File

@@ -1,6 +1,7 @@
# pragma pylint: disable=missing-docstring, protected-access, C0103
import logging
import os
from base64 import urlsafe_b64encode
import pytest
@@ -50,6 +51,14 @@ def test_load_strategy(result):
assert 'adx' in resolver.strategy.populate_indicators(result)
def test_load_strategy_byte64(result):
with open("freqtrade/tests/strategy/test_strategy.py", "r") as file:
encoded_string = urlsafe_b64encode(file.read().encode("utf-8")).decode("utf-8")
resolver = StrategyResolver({'strategy': 'TestStrategy:{}'.format(encoded_string)})
assert hasattr(resolver.strategy, 'populate_indicators')
assert 'adx' in resolver.strategy.populate_indicators(result)
def test_load_strategy_invalid_directory(result, caplog):
resolver = StrategyResolver()
extra_dir = os.path.join('some', 'path')