Exemplo n.º 1
0
    def test_from_timezone(self):
        self.assertEqual(
            EWSTimeZone('Europe/Copenhagen'),
            EWSTimeZone.from_timezone(EWSTimeZone('Europe/Copenhagen')))
        self.assertEqual(
            EWSTimeZone('Europe/Copenhagen'),
            EWSTimeZone.from_timezone(zoneinfo.ZoneInfo('Europe/Copenhagen')))
        self.assertEqual(
            EWSTimeZone('Europe/Copenhagen'),
            EWSTimeZone.from_timezone(dateutil.tz.gettz('Europe/Copenhagen')))
        self.assertEqual(
            EWSTimeZone('Europe/Copenhagen'),
            EWSTimeZone.from_timezone(pytz.timezone('Europe/Copenhagen')))

        self.assertEqual(EWSTimeZone('UTC'),
                         EWSTimeZone.from_timezone(dateutil.tz.UTC))
Exemplo n.º 2
0
    def test_from_timezone(self):
        self.assertEqual(
            EWSTimeZone("Europe/Copenhagen"),
            EWSTimeZone.from_timezone(EWSTimeZone("Europe/Copenhagen")))
        self.assertEqual(
            EWSTimeZone("Europe/Copenhagen"),
            EWSTimeZone.from_timezone(zoneinfo.ZoneInfo("Europe/Copenhagen")))
        self.assertEqual(
            EWSTimeZone("Europe/Copenhagen"),
            EWSTimeZone.from_timezone(dateutil.tz.gettz("Europe/Copenhagen")))
        self.assertEqual(
            EWSTimeZone("Europe/Copenhagen"),
            EWSTimeZone.from_timezone(pytz.timezone("Europe/Copenhagen")))

        self.assertEqual(EWSTimeZone("UTC"),
                         EWSTimeZone.from_timezone(dateutil.tz.UTC))
        self.assertEqual(EWSTimeZone("UTC"),
                         EWSTimeZone.from_timezone(datetime.timezone.utc))