Rename get_ticker to fetch_ticker

This commit is contained in:
Matthias
2019-12-18 16:34:30 +01:00
parent ce190a7485
commit 21622ac313
8 changed files with 136 additions and 136 deletions

View File

@@ -29,7 +29,7 @@ def test_rpc_trade_status(default_conf, ticker, fee, mocker) -> None:
mocker.patch('freqtrade.rpc.telegram.Telegram', MagicMock())
mocker.patch.multiple(
'freqtrade.exchange.Exchange',
get_ticker=ticker,
fetch_ticker=ticker,
get_fee=fee,
)
@@ -65,7 +65,7 @@ def test_rpc_trade_status(default_conf, ticker, fee, mocker) -> None:
'open_order': '(limit buy rem=0.00000000)'
} == results[0]
mocker.patch('freqtrade.exchange.Exchange.get_ticker',
mocker.patch('freqtrade.exchange.Exchange.fetch_ticker',
MagicMock(side_effect=DependencyException(f"Pair 'ETH/BTC' not available")))
# invalidate ticker cache
rpc._freqtrade.exchange._cached_ticker = {}
@@ -104,7 +104,7 @@ def test_rpc_status_table(default_conf, ticker, fee, mocker) -> None:
mocker.patch('freqtrade.rpc.telegram.Telegram', MagicMock())
mocker.patch.multiple(
'freqtrade.exchange.Exchange',
get_ticker=ticker,
fetch_ticker=ticker,
get_fee=fee,
)
@@ -134,7 +134,7 @@ def test_rpc_status_table(default_conf, ticker, fee, mocker) -> None:
assert 'ETH/BTC' == result[0][1]
assert '-0.59% (-0.09)' == result[0][3]
mocker.patch('freqtrade.exchange.Exchange.get_ticker',
mocker.patch('freqtrade.exchange.Exchange.fetch_ticker',
MagicMock(side_effect=DependencyException(f"Pair 'ETH/BTC' not available")))
# invalidate ticker cache
rpc._freqtrade.exchange._cached_ticker = {}
@@ -149,7 +149,7 @@ def test_rpc_daily_profit(default_conf, update, ticker, fee,
mocker.patch('freqtrade.rpc.telegram.Telegram', MagicMock())
mocker.patch.multiple(
'freqtrade.exchange.Exchange',
get_ticker=ticker,
fetch_ticker=ticker,
get_fee=fee,
markets=PropertyMock(return_value=markets)
)
@@ -201,7 +201,7 @@ def test_rpc_trade_statistics(default_conf, ticker, ticker_sell_up, fee,
mocker.patch('freqtrade.rpc.telegram.Telegram', MagicMock())
mocker.patch.multiple(
'freqtrade.exchange.Exchange',
get_ticker=ticker,
fetch_ticker=ticker,
get_fee=fee,
)
@@ -225,7 +225,7 @@ def test_rpc_trade_statistics(default_conf, ticker, ticker_sell_up, fee,
# Update the ticker with a market going up
mocker.patch.multiple(
'freqtrade.exchange.Exchange',
get_ticker=ticker_sell_up
fetch_ticker=ticker_sell_up
)
trade.update(limit_sell_order)
trade.close_date = datetime.utcnow()
@@ -239,7 +239,7 @@ def test_rpc_trade_statistics(default_conf, ticker, ticker_sell_up, fee,
# Update the ticker with a market going up
mocker.patch.multiple(
'freqtrade.exchange.Exchange',
get_ticker=ticker_sell_up
fetch_ticker=ticker_sell_up
)
trade.update(limit_sell_order)
trade.close_date = datetime.utcnow()
@@ -260,7 +260,7 @@ def test_rpc_trade_statistics(default_conf, ticker, ticker_sell_up, fee,
assert prec_satoshi(stats['best_rate'], 6.2)
# Test non-available pair
mocker.patch('freqtrade.exchange.Exchange.get_ticker',
mocker.patch('freqtrade.exchange.Exchange.fetch_ticker',
MagicMock(side_effect=DependencyException(f"Pair 'ETH/BTC' not available")))
# invalidate ticker cache
rpc._freqtrade.exchange._cached_ticker = {}
@@ -287,7 +287,7 @@ def test_rpc_trade_statistics_closed(mocker, default_conf, ticker, fee,
mocker.patch('freqtrade.rpc.telegram.Telegram', MagicMock())
mocker.patch.multiple(
'freqtrade.exchange.Exchange',
get_ticker=ticker,
fetch_ticker=ticker,
get_fee=fee,
)
@@ -306,7 +306,7 @@ def test_rpc_trade_statistics_closed(mocker, default_conf, ticker, fee,
# Update the ticker with a market going up
mocker.patch.multiple(
'freqtrade.exchange.Exchange',
get_ticker=ticker_sell_up,
fetch_ticker=ticker_sell_up,
get_fee=fee
)
trade.update(limit_sell_order)
@@ -439,7 +439,7 @@ def test_rpc_start(mocker, default_conf) -> None:
mocker.patch('freqtrade.rpc.telegram.Telegram', MagicMock())
mocker.patch.multiple(
'freqtrade.exchange.Exchange',
get_ticker=MagicMock()
fetch_ticker=MagicMock()
)
freqtradebot = get_patched_freqtradebot(mocker, default_conf)
@@ -460,7 +460,7 @@ def test_rpc_stop(mocker, default_conf) -> None:
mocker.patch('freqtrade.rpc.telegram.Telegram', MagicMock())
mocker.patch.multiple(
'freqtrade.exchange.Exchange',
get_ticker=MagicMock()
fetch_ticker=MagicMock()
)
freqtradebot = get_patched_freqtradebot(mocker, default_conf)
@@ -482,7 +482,7 @@ def test_rpc_stopbuy(mocker, default_conf) -> None:
mocker.patch('freqtrade.rpc.telegram.Telegram', MagicMock())
mocker.patch.multiple(
'freqtrade.exchange.Exchange',
get_ticker=MagicMock()
fetch_ticker=MagicMock()
)
freqtradebot = get_patched_freqtradebot(mocker, default_conf)
@@ -502,7 +502,7 @@ def test_rpc_forcesell(default_conf, ticker, fee, mocker) -> None:
cancel_order_mock = MagicMock()
mocker.patch.multiple(
'freqtrade.exchange.Exchange',
get_ticker=ticker,
fetch_ticker=ticker,
cancel_order=cancel_order_mock,
get_order=MagicMock(
return_value={
@@ -604,7 +604,7 @@ def test_performance_handle(default_conf, ticker, limit_buy_order, fee,
mocker.patch.multiple(
'freqtrade.exchange.Exchange',
get_balances=MagicMock(return_value=ticker),
get_ticker=ticker,
fetch_ticker=ticker,
get_fee=fee,
)
@@ -637,7 +637,7 @@ def test_rpc_count(mocker, default_conf, ticker, fee) -> None:
mocker.patch.multiple(
'freqtrade.exchange.Exchange',
get_balances=MagicMock(return_value=ticker),
get_ticker=ticker,
fetch_ticker=ticker,
get_fee=fee,
)
@@ -661,7 +661,7 @@ def test_rpcforcebuy(mocker, default_conf, ticker, fee, limit_buy_order) -> None
mocker.patch.multiple(
'freqtrade.exchange.Exchange',
get_balances=MagicMock(return_value=ticker),
get_ticker=ticker,
fetch_ticker=ticker,
get_fee=fee,
buy=buy_mm
)

View File

@@ -256,7 +256,7 @@ def test_api_count(botclient, mocker, ticker, fee, markets):
mocker.patch.multiple(
'freqtrade.exchange.Exchange',
get_balances=MagicMock(return_value=ticker),
get_ticker=ticker,
fetch_ticker=ticker,
get_fee=fee,
markets=PropertyMock(return_value=markets)
)
@@ -292,7 +292,7 @@ def test_api_daily(botclient, mocker, ticker, fee, markets):
mocker.patch.multiple(
'freqtrade.exchange.Exchange',
get_balances=MagicMock(return_value=ticker),
get_ticker=ticker,
fetch_ticker=ticker,
get_fee=fee,
markets=PropertyMock(return_value=markets)
)
@@ -308,7 +308,7 @@ def test_api_edge_disabled(botclient, mocker, ticker, fee, markets):
mocker.patch.multiple(
'freqtrade.exchange.Exchange',
get_balances=MagicMock(return_value=ticker),
get_ticker=ticker,
fetch_ticker=ticker,
get_fee=fee,
markets=PropertyMock(return_value=markets)
)
@@ -323,7 +323,7 @@ def test_api_profit(botclient, mocker, ticker, fee, markets, limit_buy_order, li
mocker.patch.multiple(
'freqtrade.exchange.Exchange',
get_balances=MagicMock(return_value=ticker),
get_ticker=ticker,
fetch_ticker=ticker,
get_fee=fee,
markets=PropertyMock(return_value=markets)
)
@@ -413,7 +413,7 @@ def test_api_status(botclient, mocker, ticker, fee, markets):
mocker.patch.multiple(
'freqtrade.exchange.Exchange',
get_balances=MagicMock(return_value=ticker),
get_ticker=ticker,
fetch_ticker=ticker,
get_fee=fee,
markets=PropertyMock(return_value=markets)
)
@@ -541,7 +541,7 @@ def test_api_forcesell(botclient, mocker, ticker, fee, markets):
mocker.patch.multiple(
'freqtrade.exchange.Exchange',
get_balances=MagicMock(return_value=ticker),
get_ticker=ticker,
fetch_ticker=ticker,
get_fee=fee,
markets=PropertyMock(return_value=markets)
)

View File

@@ -150,7 +150,7 @@ def test_status(default_conf, update, mocker, fee, ticker,) -> None:
mocker.patch.multiple(
'freqtrade.exchange.Exchange',
get_ticker=ticker,
fetch_ticker=ticker,
get_fee=fee,
)
msg_mock = MagicMock()
@@ -204,7 +204,7 @@ def test_status(default_conf, update, mocker, fee, ticker,) -> None:
def test_status_handle(default_conf, update, ticker, fee, mocker) -> None:
mocker.patch.multiple(
'freqtrade.exchange.Exchange',
get_ticker=ticker,
fetch_ticker=ticker,
get_fee=fee,
)
msg_mock = MagicMock()
@@ -254,7 +254,7 @@ def test_status_handle(default_conf, update, ticker, fee, mocker) -> None:
def test_status_table_handle(default_conf, update, ticker, fee, mocker) -> None:
mocker.patch.multiple(
'freqtrade.exchange.Exchange',
get_ticker=ticker,
fetch_ticker=ticker,
buy=MagicMock(return_value={'id': 'mocked_order_id'}),
get_fee=fee,
)
@@ -307,7 +307,7 @@ def test_daily_handle(default_conf, update, ticker, limit_buy_order, fee,
)
mocker.patch.multiple(
'freqtrade.exchange.Exchange',
get_ticker=ticker,
fetch_ticker=ticker,
get_fee=fee,
)
msg_mock = MagicMock()
@@ -373,7 +373,7 @@ def test_daily_handle(default_conf, update, ticker, limit_buy_order, fee,
def test_daily_wrong_input(default_conf, update, ticker, mocker) -> None:
mocker.patch.multiple(
'freqtrade.exchange.Exchange',
get_ticker=ticker
fetch_ticker=ticker
)
msg_mock = MagicMock()
mocker.patch.multiple(
@@ -411,7 +411,7 @@ def test_profit_handle(default_conf, update, ticker, ticker_sell_up, fee,
mocker.patch('freqtrade.rpc.rpc.CryptoToFiatConverter._find_price', return_value=15000.0)
mocker.patch.multiple(
'freqtrade.exchange.Exchange',
get_ticker=ticker,
fetch_ticker=ticker,
get_fee=fee,
)
msg_mock = MagicMock()
@@ -443,7 +443,7 @@ def test_profit_handle(default_conf, update, ticker, ticker_sell_up, fee,
msg_mock.reset_mock()
# Update the ticker with a market going up
mocker.patch('freqtrade.exchange.Exchange.get_ticker', ticker_sell_up)
mocker.patch('freqtrade.exchange.Exchange.fetch_ticker', ticker_sell_up)
trade.update(limit_sell_order)
trade.close_date = datetime.utcnow()
@@ -700,7 +700,7 @@ def test_forcesell_handle(default_conf, update, ticker, fee,
patch_whitelist(mocker, default_conf)
mocker.patch.multiple(
'freqtrade.exchange.Exchange',
get_ticker=ticker,
fetch_ticker=ticker,
get_fee=fee,
)
@@ -715,7 +715,7 @@ def test_forcesell_handle(default_conf, update, ticker, fee,
assert trade
# Increase the price and sell it
mocker.patch('freqtrade.exchange.Exchange.get_ticker', ticker_sell_up)
mocker.patch('freqtrade.exchange.Exchange.fetch_ticker', ticker_sell_up)
# /forcesell 1
context = MagicMock()
@@ -755,7 +755,7 @@ def test_forcesell_down_handle(default_conf, update, ticker, fee,
mocker.patch.multiple(
'freqtrade.exchange.Exchange',
get_ticker=ticker,
fetch_ticker=ticker,
get_fee=fee,
)
@@ -769,7 +769,7 @@ def test_forcesell_down_handle(default_conf, update, ticker, fee,
# Decrease the price and sell it
mocker.patch.multiple(
'freqtrade.exchange.Exchange',
get_ticker=ticker_sell_down
fetch_ticker=ticker_sell_down
)
trade = Trade.query.first()
@@ -812,7 +812,7 @@ def test_forcesell_all_handle(default_conf, update, ticker, fee, mocker) -> None
patch_whitelist(mocker, default_conf)
mocker.patch.multiple(
'freqtrade.exchange.Exchange',
get_ticker=ticker,
fetch_ticker=ticker,
get_fee=fee,
)
default_conf['max_open_trades'] = 4
@@ -963,7 +963,7 @@ def test_performance_handle(default_conf, update, ticker, fee,
)
mocker.patch.multiple(
'freqtrade.exchange.Exchange',
get_ticker=ticker,
fetch_ticker=ticker,
get_fee=fee,
)
freqtradebot = get_patched_freqtradebot(mocker, default_conf)
@@ -998,7 +998,7 @@ def test_count_handle(default_conf, update, ticker, fee, mocker) -> None:
)
mocker.patch.multiple(
'freqtrade.exchange.Exchange',
get_ticker=ticker,
fetch_ticker=ticker,
buy=MagicMock(return_value={'id': 'mocked_order_id'}),
get_fee=fee,
)