Example #1
0
 def test_1070(self, dt_fixture):
     """dt_from_ts():
 - Naive dt is assumed to be at UTC
 - Round trips preserve original value
 """
     dt_utc = dt.normalize_datetime_to_utc(dt_fixture)
     assert dt.dt_from_ts(dt.ts_from_dt(dt_fixture),
                          dt_fixture.tzinfo) == dt_utc
Example #2
0
 def test_1130(self):
     """ts_from_dt(): Includes timezone (YEKT, UTC+6)"""
     assert dt.ts_from_dt(T1_YEKT) == T1_UTC_EPOCH - 6 * 3600
Example #3
0
 def test_1120(self):
     """ts_from_dt(): Includes timezone (MST, UTC-7)"""
     assert dt.ts_from_dt(T1_MST) == T1_UTC_EPOCH + 7 * 3600
Example #4
0
 def test_1110(self):
     """ts_from_dt(): Assumes naive datetime is in UTC"""
     assert dt.ts_from_dt(T1_NAIVE) == T1_UTC_EPOCH
Example #5
0
 def test_1070(self, dt_fixture):
     """dt_from_ts(): Round trips preserve original value"""
     assert dt.dt_from_ts(dt.ts_from_dt(dt_fixture),
                          dt_fixture.tzinfo) == dt_fixture
Example #6
0
 def test_1060(self):
     """ts_from_dt(): Includes tz"""
     assert dt.ts_from_dt(T1_MST) != dt.ts_from_dt(T1_UTC)
Example #7
0
 def test_1050(self):
     """ts_from_dt(): Assumes naive dt to be in UTC"""
     assert dt.ts_from_dt(T1_NAIVE) == dt.ts_from_dt(T1_UTC)