Exemple #1
0
 def test_1240(self):
     """normalize_datetime_to_utc(): Adjusts for tz"""
     t1_utc = dt.normalize_datetime_to_utc(T_ABS_1)
     t2_utc = dt.normalize_datetime_to_utc(T_ABS_2)
     assert dt.is_utc(t1_utc)
     assert dt.is_utc(t2_utc)
     assert dt.are_equal(t1_utc, t2_utc)
Exemple #2
0
 def test_1090(self, rounding_fixture, tz_fixture):
     """are_equal(): Returns True if two naive dts are equal to within the fuzz
 factor
 """
     round_sec, t, t_rounded = rounding_fixture
     t = t.replace(tzinfo=tz_fixture)
     t_rounded = t_rounded.replace(tzinfo=tz_fixture)
     logging.debug('round_sec={} t={} t_rounded={}'.format(
         round_sec, t, t_rounded))
     assert dt.are_equal(t, t_rounded, round_sec)
Exemple #3
0
 def test_1260(self):
     """normalize_datetime_to_utc(): Includes tz"""
     utc_dt = dt.normalize_datetime_to_utc(T1_YEKT)
     assert dt.is_utc(utc_dt)
     assert dt.are_equal(utc_dt, T1_YEKT)
Exemple #4
0
 def test_1250(self):
     """normalize_datetime_to_utc(): Assumes that naive dt is in UTC"""
     utc_dt = dt.normalize_datetime_to_utc(T2_NAIVE)
     assert dt.is_utc(utc_dt)
     assert dt.are_equal(utc_dt, T2_NAIVE)
Exemple #5
0
 def test_1100(self):
     """are_equal(): Returns True when comparing the same point in time specified
 in two different tz
 """
     assert dt.are_equal(T_ABS_1, T_ABS_2)