Beispiel #1
0
    def test_always_up(self):
        # Time and location where the sun is always up
        t = 1371044003  # 2013-06-12 06:33:23 PDT (1371044003)
        almanac = Almanac(t, 74.0, 0.0, formatter=default_formatter)
        self.assertIsNone(almanac(horizon=-6).sun(use_center=1).rise.raw)
        self.assertIsNone(almanac(horizon=-6).sun(use_center=1).set.raw)
        self.assertEqual(
            almanac(horizon=-6).sun(use_center=1).visible.raw, 86400)
        self.assertEqual(str(almanac(horizon=-6).sun(use_center=1).visible),
                         "24 hours, 0 minutes, 0 seconds")

        # Now where the sun is always down:
        almanac = Almanac(t, -74.0, 0.0, formatter=default_formatter)
        self.assertIsNone(almanac(horizon=-6).sun(use_center=1).rise.raw)
        self.assertIsNone(almanac(horizon=-6).sun(use_center=1).set.raw)
        self.assertEqual(almanac(horizon=-6).sun(use_center=1).visible.raw, 0)
        self.assertEqual(str(almanac(horizon=-6).sun(use_center=1).visible),
                         "0 hours, 0 minutes, 0 seconds")
Beispiel #2
0
 def test_always_up(self):
     # Time and location where the sun is always up
     t = 1371044003  # 2013-06-12 06:33:23 PDT (1371044003)
     almanac = Almanac(t, 64.0, 0.0)
     self.assertIsNone(almanac(horizon=-6).sun(use_center=1).rise.raw)