Move shorten_date to datetime helpers

This commit is contained in:
Matthias
2023-05-15 19:55:54 +02:00
parent b40c45ee42
commit f657d06e91
6 changed files with 26 additions and 24 deletions

View File

@@ -12,7 +12,7 @@ from freqtrade.misc import (dataframe_to_json, decimals_per_coin, deep_merge_dic
file_load_json, format_ms_time, json_to_dataframe, pair_to_filename,
parse_db_uri_for_logging, plural, render_template,
render_template_with_fallback, round_coin_value, safe_value_fallback,
safe_value_fallback2, shorten_date)
safe_value_fallback2)
def test_decimals_per_coin():
@@ -39,12 +39,6 @@ def test_round_coin_value():
assert round_coin_value(222.2, 'USDT', False, True) == '222.200'
def test_shorten_date() -> None:
str_data = '1 day, 2 hours, 3 minutes, 4 seconds ago'
str_shorten_data = '1 d, 2 h, 3 min, 4 sec ago'
assert shorten_date(str_data) == str_shorten_data
def test_file_dump_json(mocker) -> None:
file_open = mocker.patch('freqtrade.misc.Path.open', MagicMock())
json_dump = mocker.patch('rapidjson.dump', MagicMock())