(self)
| 2716 | self.assertEqual(self.theclass.fromtimestamp(s), t) |
| 2717 | |
| 2718 | def test_timestamp_aware(self): |
| 2719 | t = self.theclass(1970, 1, 1, tzinfo=timezone.utc) |
| 2720 | self.assertEqual(t.timestamp(), 0.0) |
| 2721 | t = self.theclass(1970, 1, 1, 1, 2, 3, 4, tzinfo=timezone.utc) |
| 2722 | self.assertEqual(t.timestamp(), |
| 2723 | 3600 + 2*60 + 3 + 4*1e-6) |
| 2724 | t = self.theclass(1970, 1, 1, 1, 2, 3, 4, |
| 2725 | tzinfo=timezone(timedelta(hours=-5), 'EST')) |
| 2726 | self.assertEqual(t.timestamp(), |
| 2727 | 18000 + 3600 + 2*60 + 3 + 4*1e-6) |
| 2728 | |
| 2729 | @support.run_with_tz('MSK-03') # Something east of Greenwich |
| 2730 | def test_microsecond_rounding(self): |
nothing calls this directly
no test coverage detected