Пример #1
0
    def test_gregorian(self):
        assert gregorian.to_jd(*self.gregoriandate) == self.jd
        assert gregorian.to_jd2(*self.gregoriandate) == self.jd

        self.assertEqual(self.c, 2266295.5)
        assert gregorian.to_jd(2000, 1, 1) == 2451544.5

        assert gregorian.to_jd2(2000, 1, 1) == 2451544.5

        self.reflexive(gregorian.from_jd, gregorian.to_jd)
Пример #2
0
    def test_gregorian_proleptic(self):
        self.assertEqual(gregorian.to_jd(72, 6, 27), 1747535.5)
        assert gregorian.to_jd2(72, 6, 27) == 1747535.5

        for y in range(int(gregorian.EPOCH), int(gregorian.EPOCH) - 10000, -250):
            assert gregorian.to_jd(*gregorian.from_jd(y)) == y - 0.5

        assert gregorian.from_jd(gregorian.to_jd(-1, 3, 1)) == (-1, 3, 1)
        assert gregorian.from_jd(gregorian.to_jd(-100, 7, 1)) == (-100, 7, 1)
        assert gregorian.from_jd(gregorian.to_jd(-500, 12, 31)) == (-500, 12, 31)
        assert gregorian.from_jd(gregorian.to_jd(-1000, 1, 1)) == (-1000, 1, 1)
Пример #3
0
 def test_gregorian_2_ma(self):
     assert gregorian.to_jd2(*self.c_greg) == 2266295.5