GregorianCalendar

class badidatetime.tests.test_gregorian_calendar.TestGregorianCalendar(name)[source]

Bases: TestCase

This test class provides unittests for the GregorianCalendar class. Many tests use the Gregorian dates and their corresponding fixed dates below.

March 19, 1844 = Historic JD 2394645.11511552 (Baha’i Epoch)
January, 1, 1970 = Historic JD 2440587.5 (UNIX Epoch)
_classSetupFailed = False
_class_cleanups = []
setUp()[source]

Hook method for setting up the test fixture before exercising it.

test__check_valid_gregorian_month_day()[source]

Check that the year, month, day, hour, minute, and second in a gregorian date are in bounds. Also check that if a decimal number is used there are no succeeding number at all.

test__is_leap_year()[source]

Test that the _is_leap_year method correctly determines the Gregorian leap year.

test_date_from_ymdhms()[source]

Test that the date_from_ymdhms method returns a (year, month, day.partial) from a (year, month, day, hour, minute, second).

test_gregorian_date_from_jd()[source]

Test that the gregorian_date_from_jd method returns a Gregorian date from a Julian day.

test_gregorian_year_from_jd()[source]

Test that the gregorian_year_from_jd method returns a Gregorian year from a Julian day.

test_jd_from_gregorian_date()[source]

Test that the jd_from_gregorian_date method returns a Julian day from a Gregorian date.

test_posix_timestamp()[source]

Test that the posix_timestamp method returns the year, month, day, hours, minutes, and seconds for a POSIX timestamp.

* TODO * This method is giving wrong results.

test_ymdhms_from_date()[source]

Test that the ymdhms_from_date method returns a (year, month, day, hour, minute, second) from a (year, month, day.partial).