Exemplo n.º 1
0
    def test_from_jd(self):
        self.assertTrue(legal_date(*from_jd(2375479.5)))
        assert legal_date(*from_jd(2376479.5))
        assert legal_date(*from_jd(2378479.5))
        assert legal_date(*from_jd(2379479.5))

        with self.assertRaises(ValueError):
            from_jd(EPOCH - 0.5)
Exemplo n.º 2
0
    def test_from_jd(self):
        self.assertTrue(legal_date(*from_jd(2375479.5)))
        assert legal_date(*from_jd(2376479.5))
        assert legal_date(*from_jd(2378479.5))
        assert legal_date(*from_jd(2379479.5))

        with self.assertRaises(ValueError):
            from_jd(EPOCH - 0.5)
Exemplo n.º 3
0
    def test_legaldate(self):
        self.assertTrue(legal_date(1, 1, 1))
        with self.assertRaises(ValueError):
            legal_date(0, 1, 1)

        with self.assertRaises(ValueError):
            legal_date(1, -1, 1)

        with self.assertRaises(ValueError):
            legal_date(1, 14, 3)

        with self.assertRaises(ValueError):
            legal_date(1, 16, 3)
Exemplo n.º 4
0
    def test_legaldate(self):
        self.assertTrue(legal_date(1, 1, 1))
        with self.assertRaises(ValueError):
            legal_date(0, 1, 1)

        with self.assertRaises(ValueError):
            legal_date(1, -1, 1)

        with self.assertRaises(ValueError):
            legal_date(1, 14, 3)

        with self.assertRaises(ValueError):
            legal_date(1, 16, 3)