示例#1
0
def test_julian_date_conversion_before_march():  # pylint: disable=invalid-name
    """Test that a date before March can be converted to a Julian date."""
    conversion_date = date(2016, 1, 18)

    result = calculations.gregorian_to_julian(conversion_date)
    expected = 2457406

    assert result == expected, \
        "Gregorian date %s should be %d, got %d" % (
            conversion_date,
            expected,
            result,
        )
示例#2
0
def test_julian_date_conversion():
    """Test that a Gregorian date can be converted to a Julian date."""
    conversion_date = date(2015, 12, 14)

    result = calculations.gregorian_to_julian(conversion_date)
    expected = 2457371

    assert result == expected, \
        "Gregorian date %s should be %d, got %d" % (
            conversion_date,
            expected,
            result,
        )