tests.test_humanize moduleΒΆ

Tests for the human-readable renderings of machine quantities.

tests.test_humanize.test_format_file_size(size_bytes, expected)[source]ΒΆ

Human-readable file size formatting.

Return type:

None

tests.test_humanize.test_format_age(days_ago, expected)[source]ΒΆ

An mtime renders as whole days, singular for one.

Return type:

None

tests.test_humanize.test_utc_midnight_starts_the_day()[source]ΒΆ

A date carries no time of day, so it enters a countdown at midnight.

Return type:

None

tests.test_humanize.test_shift_months_clamps_the_day(instant, months, expected)[source]ΒΆ

A month shift lands on the last day of a shorter target month.

Return type:

None

tests.test_humanize.test_format_relative_buckets(offset, ahead, behind)[source]ΒΆ

Each gap falls in one bucket, phrased ahead of or behind the reference.

Return type:

None

tests.test_humanize.test_format_countdown(deadline, reference, expected)[source]ΒΆ

A countdown follows the precision of the instants it is given.

Return type:

None

tests.test_humanize.test_format_elapsed(instant, reference, expected)[source]ΒΆ

The past-facing mirror drops its phrase in the other direction.

Return type:

None

tests.test_humanize.test_today_utc_is_the_utc_date()[source]ΒΆ

The date is read on the UTC clock, not on the local one.

tests.test_humanize.test_parse_iso_datetime(value, expected)[source]ΒΆ

An instant parses to an aware datetime; nothing, or garbage, to None.