Merge branch 'feat/short' into lev-freqtradebot
This commit is contained in:
@@ -605,16 +605,33 @@ def test_get_ui_download_url(mocker):
|
||||
def test_get_ui_download_url_direct(mocker):
|
||||
response = MagicMock()
|
||||
response.json = MagicMock(
|
||||
side_effect=[[{
|
||||
'assets_url': 'http://whatever.json',
|
||||
'name': '0.0.1',
|
||||
'assets': [{'browser_download_url': 'http://download11.zip'}]}]])
|
||||
return_value=[
|
||||
{
|
||||
'assets_url': 'http://whatever.json',
|
||||
'name': '0.0.2',
|
||||
'assets': [{'browser_download_url': 'http://download22.zip'}]
|
||||
},
|
||||
{
|
||||
'assets_url': 'http://whatever.json',
|
||||
'name': '0.0.1',
|
||||
'assets': [{'browser_download_url': 'http://download1.zip'}]
|
||||
},
|
||||
])
|
||||
get_mock = mocker.patch("freqtrade.commands.deploy_commands.requests.get",
|
||||
return_value=response)
|
||||
x, last_version = get_ui_download_url()
|
||||
assert get_mock.call_count == 1
|
||||
assert last_version == '0.0.2'
|
||||
assert x == 'http://download22.zip'
|
||||
get_mock.reset_mock()
|
||||
response.json.reset_mock()
|
||||
|
||||
x, last_version = get_ui_download_url('0.0.1')
|
||||
assert last_version == '0.0.1'
|
||||
assert x == 'http://download11.zip'
|
||||
assert x == 'http://download1.zip'
|
||||
|
||||
with pytest.raises(ValueError, match="UI-Version not found."):
|
||||
x, last_version = get_ui_download_url('0.0.3')
|
||||
|
||||
|
||||
def test_download_data_keyboardInterrupt(mocker, caplog, markets):
|
||||
|
Reference in New Issue
Block a user