tests.sphinx.test_sphinx_announcement moduleΒΆ

Tests for the year count of an announcement banner.

tests.sphinx.test_sphinx_announcement.anniversaries(start, day)[source]ΒΆ

Count the anniversaries of start that day has reached, one at a time.

Counted apart from years_since(), so the test does not grade a formula against itself. start cannot be a 29 February, which date.replace cannot move to a common year.

Return type:

int

tests.sphinx.test_sphinx_announcement.test_years_since_on_every_day_of_a_leap_span()[source]ΒΆ

The count goes up on each anniversary, and never a day before it.

The span holds the leap days of 2024, 2028 and 2032. Each moves a count of days divided by 365 one day further ahead, which the last assertion checks the span catches.

Return type:

None

tests.sphinx.test_sphinx_announcement.test_years_since_a_leap_day(today, expected)[source]ΒΆ

A start on 29 February has its anniversary on 1 March of a common year.

Return type:

None

tests.sphinx.test_sphinx_announcement.test_years_since_counts_to_the_current_day()[source]ΒΆ

Without today, the count ends on the current day in UTC.

Return type:

None