Ejemplo n.º 1
0
def test_rpc_whitelist(mocker, default_conf) -> None:
    patch_exchange(mocker)
    mocker.patch('freqtrade.rpc.telegram.Telegram', MagicMock())

    freqtradebot = FreqtradeBot(default_conf)
    rpc = RPC(freqtradebot)
    ret = rpc._rpc_whitelist()
    assert ret['method'] == 'StaticPairList'
    assert ret['whitelist'] == default_conf['exchange']['pair_whitelist']
Ejemplo n.º 2
0
def test_rpc_whitelist(mocker, default_conf) -> None:
    mocker.patch('freqtrade.rpc.telegram.Telegram', MagicMock())

    freqtradebot = get_patched_freqtradebot(mocker, default_conf)
    rpc = RPC(freqtradebot)
    ret = rpc._rpc_whitelist()
    assert len(ret['method']) == 1
    assert 'StaticPairList' in ret['method']
    assert ret['whitelist'] == default_conf['exchange']['pair_whitelist']
Ejemplo n.º 3
0
def test_rpc_whitelist_dynamic(mocker, default_conf) -> None:
    default_conf['pairlists'] = [{'method': 'VolumePairList',
                                  'number_assets': 4,
                                  }]
    mocker.patch('freqtrade.exchange.Exchange.exchange_has', MagicMock(return_value=True))
    mocker.patch('freqtrade.rpc.telegram.Telegram', MagicMock())

    freqtradebot = get_patched_freqtradebot(mocker, default_conf)
    rpc = RPC(freqtradebot)
    ret = rpc._rpc_whitelist()
    assert len(ret['method']) == 1
    assert 'VolumePairList' in ret['method']
    assert ret['length'] == 4
    assert ret['whitelist'] == default_conf['exchange']['pair_whitelist']
Ejemplo n.º 4
0
def test_rpc_whitelist_dynamic(mocker, default_conf) -> None:
    patch_exchange(mocker)
    default_conf['pairlist'] = {'method': 'VolumePairList',
                                'config': {'number_assets': 4}
                                }
    mocker.patch('freqtrade.exchange.Exchange.exchange_has', MagicMock(return_value=True))
    mocker.patch('freqtrade.rpc.telegram.Telegram', MagicMock())

    freqtradebot = FreqtradeBot(default_conf)
    rpc = RPC(freqtradebot)
    ret = rpc._rpc_whitelist()
    assert ret['method'] == 'VolumePairList'
    assert ret['length'] == 4
    assert ret['whitelist'] == default_conf['exchange']['pair_whitelist']
Ejemplo n.º 5
0
def whitelist(rpc: RPC = Depends(get_rpc)):
    return rpc._rpc_whitelist()