Browse Source

test: not multiples indicators on prop init

Signed-off-by: QuentinN42 <quentin@lieumont.fr>
pull/19/head
QuentinN42 7 months ago
parent
commit
4cf09d929c
Signed by: number42 GPG Key ID: 2CD7D563712B3A50
  1. 7
      tests/strat/test_prop.py

7
tests/strat/test_prop.py

@ -6,6 +6,7 @@ from auto_trading.strat.prop import Prop
from auto_trading.indicators.dumb import Dumb
from auto_trading.interfaces import PTFState
from auto_trading.orders import Long, Short
from auto_trading.errors import StrategyInitError
date = datetime.strptime("2015-03-31", "%Y-%m-%d")
@ -59,3 +60,9 @@ def test_prop(max_delta, data, indicators_results, state, results):
assert len(res) == len(results)
for result in results:
assert result in res
def test_not_multiples_indicators():
ind = Dumb(Series({"GOOG": 1, "GOOGL": -1}))
with pytest.raises(StrategyInitError):
Prop(indicators={"one": ind, "two": ind})

Loading…
Cancel
Save