From 2b5d61c9e41fffd4ba31173aad3b51966206e696 Mon Sep 17 00:00:00 2001 From: Matthias Voppichler Date: Sun, 4 Mar 2018 15:24:06 +0100 Subject: [PATCH] fix persistance test --- freqtrade/tests/test_persistence.py | 37 ++++++++++++++--------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/freqtrade/tests/test_persistence.py b/freqtrade/tests/test_persistence.py index 401de7acb..8ff8f22ae 100644 --- a/freqtrade/tests/test_persistence.py +++ b/freqtrade/tests/test_persistence.py @@ -2,7 +2,6 @@ import os import pytest from sqlalchemy import create_engine -from freqtrade.exchange import Exchanges from freqtrade.persistence import Trade, init, clean_dry_run_db @@ -117,10 +116,10 @@ def test_update_with_bittrex(limit_buy_order, limit_sell_order): """ trade = Trade( - pair='BTC_ETH', + pair='ETH/BTC', stake_amount=0.001, fee=0.0025, - exchange=Exchanges.BITTREX, + exchange="BITTREX", ) assert trade.open_order_id is None assert trade.open_rate is None @@ -144,10 +143,10 @@ def test_update_with_bittrex(limit_buy_order, limit_sell_order): def test_calc_open_close_trade_price(limit_buy_order, limit_sell_order): trade = Trade( - pair='BTC_ETH', + pair='ETH/BTC', stake_amount=0.001, fee=0.0025, - exchange=Exchanges.BITTREX, + exchange="BITTREX", ) trade.open_order_id = 'something' @@ -166,10 +165,10 @@ def test_calc_open_close_trade_price(limit_buy_order, limit_sell_order): def test_calc_close_trade_price_exception(limit_buy_order): trade = Trade( - pair='BTC_ETH', + pair='ETH/BTC', stake_amount=0.001, fee=0.0025, - exchange=Exchanges.BITTREX, + exchange="BITTREX", ) trade.open_order_id = 'something' @@ -179,10 +178,10 @@ def test_calc_close_trade_price_exception(limit_buy_order): def test_update_open_order(limit_buy_order): trade = Trade( - pair='BTC_ETH', + pair='ETH/BTC', stake_amount=1.00, fee=0.1, - exchange=Exchanges.BITTREX, + exchange="BITTREX", ) assert trade.open_order_id is None @@ -201,10 +200,10 @@ def test_update_open_order(limit_buy_order): def test_update_invalid_order(limit_buy_order): trade = Trade( - pair='BTC_ETH', + pair='ETH/BTC', stake_amount=1.00, fee=0.1, - exchange=Exchanges.BITTREX, + exchange="BITTREX" ) limit_buy_order['type'] = 'invalid' with pytest.raises(ValueError, match=r'Unknown order type'): @@ -213,10 +212,10 @@ def test_update_invalid_order(limit_buy_order): def test_calc_open_trade_price(limit_buy_order): trade = Trade( - pair='BTC_ETH', + pair='ETH/BTC', stake_amount=0.001, fee=0.0025, - exchange=Exchanges.BITTREX, + exchange="BITTREX", ) trade.open_order_id = 'open_trade' trade.update(limit_buy_order) # Buy @ 0.00001099 @@ -230,10 +229,10 @@ def test_calc_open_trade_price(limit_buy_order): def test_calc_close_trade_price(limit_buy_order, limit_sell_order): trade = Trade( - pair='BTC_ETH', + pair='ETH/BTC', stake_amount=0.001, fee=0.0025, - exchange=Exchanges.BITTREX, + exchange="BITTREX", ) trade.open_order_id = 'close_trade' trade.update(limit_buy_order) # Buy @ 0.00001099 @@ -251,10 +250,10 @@ def test_calc_close_trade_price(limit_buy_order, limit_sell_order): def test_calc_profit(limit_buy_order, limit_sell_order): trade = Trade( - pair='BTC_ETH', + pair='ETH/BTC', stake_amount=0.001, fee=0.0025, - exchange=Exchanges.BITTREX, + exchange="BITTREX", ) trade.open_order_id = 'profit_percent' trade.update(limit_buy_order) # Buy @ 0.00001099 @@ -285,10 +284,10 @@ def test_calc_profit(limit_buy_order, limit_sell_order): def test_calc_profit_percent(limit_buy_order, limit_sell_order): trade = Trade( - pair='BTC_ETH', + pair='ETH/BTC', stake_amount=0.001, fee=0.0025, - exchange=Exchanges.BITTREX, + exchange="BITTREX", ) trade.open_order_id = 'profit_percent' trade.update(limit_buy_order) # Buy @ 0.00001099