Home | History | Annotate | Download | only in test

Lines Matching defs:DST

58     def dst(self, dt):
75 self.assertRaises(NotImplementedError, useless.dst, dt)
89 self.assertRaises(NotImplementedError, ne.dst, dt)
97 self.assertEqual(fo.dst(dt), timedelta(minutes=42))
1648 def dst(self, dt): return timedelta(0)
1654 def dst
2004 dst = utcoffset
2013 self.assertEqual(obj.dst(), expected)
2063 def dst(self, dt): return None
2069 self.assertTrue(t.dst() is None)
2074 def dst(self, dt): return timedelta(minutes=1439)
2078 self.assertEqual(t.dst(), timedelta(minutes=1439))
2084 def dst(self, dt): return 7
2088 self.assertRaises(TypeError, t.dst)
2094 def dst(self, dt): return timedelta(hours=24)
2097 self.assertRaises(ValueError, t.dst)
2102 def dst(self, dt): return timedelta(microseconds=-81)
2105 self.assertRaises(ValueError, t.dst)
2194 self.assertEqual(t1.dst(), timedelta(minutes=1))
2195 self.assertEqual(t2.dst(), timedelta(minutes=-2))
2196 self.assertEqual(t3.dst(), timedelta(minutes=3))
2197 self.assertTrue(t4.dst() is None)
2198 self.assertRaises(TypeError, t1.dst, "no args")
2720 # DST flag.
2721 class DST(tzinfo):
2726 def dst(self, dt):
2731 d = cls(1, 1, 1, 10, 20, 30, 40, tzinfo=DST(dstvalue))
2743 # dst() returns wrong type.
2744 self.assertRaises(TypeError, cls(1, 1, 1, tzinfo=DST("x")).timetuple)
2746 # dst() at the edge.
2747 self.assertEqual(cls(1,1,1, tzinfo=DST(1439)).timetuple().tm_isdst, 1)
2748 self.assertEqual(cls(1,1,1, tzinfo=DST(-1439)).timetuple().tm_isdst, 1)
2750 # dst() out of range.
2751 self.assertRaises(ValueError, cls(1,1,1, tzinfo=DST(1440)).timetuple)
2752 self.assertRaises(ValueError, cls(1,1,1, tzinfo=DST(-1440)).timetuple)
2755 class DST(tzinfo):
2760 def dst(self, dt):
2764 # This can't work: DST didn't implement utcoffset.
2766 cls(1, 1, 1, tzinfo=DST(0)).utcoffset)
2768 class UOFS(DST):
2770 DST.__init__(self, dofs)
2775 # Ensure tm_isdst is 0 regardless of what dst() says: DST is never
3008 # Pain to set up DST-aware tzinfo classes.
3019 # In the US, DST starts at 2am (standard time) on the first Sunday in April.
3021 # and ends at 2am (DST time; 1am standard time) on the last Sunday of Oct,
3024 # the last hour of DST (that's 1:MM DST, but 1:MM is taken as standard time).
3039 if self.dst(dt):
3045 return self.stdoffset + self.dst(dt)
3047 def dst(self, dt):
3079 # The DST switch times for 2002, in std time.
3085 # Check a time that's inside DST.
3087 self.assertEqual(dt.dst(), HOUR)
3097 # UTC time when DST begins: the clock jumps from 1:59:59
3109 self.assertEqual(there_and_back.dst(), ZERO)
3117 # Because we have a redundant spelling when DST begins, there is
3118 # (unfortunately) an hour when DST ends that can't be spelled at all in
3119 # local time. When DST ends, the clock jumps from 1:59 back to 1:00
3120 # again. The hour 1:MM DST has no spelling then: 1:MM is taken to be
3121 # standard time. 1:MM DST == 0:MM EST, but 0:MM is taken to be
3128 # We're in the hour before the last DST hour. The last DST hour
3137 # Check a time that's outside DST.
3139 self.assertEqual(dt.dst(), ZERO)
3151 # Because 1:MM on the day DST ends is taken as being standard time,
3153 # For purposes of the test, the last hour of DST is 0:MM, which is
3186 # For these adjacent DST-aware time zones, the range of time offsets
3200 # 22:00-0900 is 7:00 UTC == 2:00 EST == 3:00 DST. Since it's "after
3211 # Similar, but map to 6:00 UTC == 1:00 EST == 2:00 DST. In that
3221 # Now on the day DST ends, we want "repeat an hour" behavior.
3249 def dst(self, dt): return HOUR
3257 def dst(self, dt): return None
3280 # Check around DST start.
3301 # Check around DST end.