How to use the aria2p.utils.human_readable_timedelta function in aria2p

To help you get started, we’ve selected a few aria2p examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pawamoy / aria2p / tests / test_utils.py View on Github external
def test_human_readable_timedelta_only_days():
    assert human_readable_timedelta(timedelta(days=3)) == "3d"
github pawamoy / aria2p / tests / test_utils.py View on Github external
def test_human_readable_timedelta_one_second():
    assert human_readable_timedelta(timedelta(seconds=1)) == "1s"
github pawamoy / aria2p / tests / test_utils.py View on Github external
def test_human_readable_timedelta_0_hours_0_minutes():
    assert human_readable_timedelta(timedelta(days=3, seconds=3)) == "3d3s"
github pawamoy / aria2p / tests / test_utils.py View on Github external
def test_human_readable_timedelta_more_than_1day_worth_seconds():
    assert human_readable_timedelta(timedelta(seconds=3600 * 24 + 2)) == "1d2s"
github pawamoy / aria2p / tests / test_utils.py View on Github external
def test_human_readable_timedelta_only_minutes():
    assert human_readable_timedelta(timedelta(seconds=60 * 3)) == "3m"
github pawamoy / aria2p / tests / test_utils.py View on Github external
def test_human_readable_timedelta_more_than_60_seconds():
    assert human_readable_timedelta(timedelta(seconds=75)) == "1m15s"
github pawamoy / aria2p / tests / test_utils.py View on Github external
def test_human_readable_timedelta_more_than_3600_seconds():
    assert human_readable_timedelta(timedelta(seconds=3601)) == "1h1s"
github pawamoy / aria2p / tests / test_utils.py View on Github external
def test_human_readable_timedelta_one_day_plus_more_than_1day_worth_seconds():
    assert human_readable_timedelta(timedelta(days=1, seconds=3600 * 24 + 2)) == "2d2s"
github pawamoy / aria2p / tests / test_utils.py View on Github external
def test_human_readable_timedelta_force_print_0_seconds():
    assert human_readable_timedelta(timedelta(seconds=0)) == "0s"
github pawamoy / aria2p / tests / test_utils.py View on Github external
def test_human_readable_timedelta_only_hours():
    assert human_readable_timedelta(timedelta(seconds=3600 * 3)) == "3h"