X-Git-Url: http://www.git.cypherpunks.ru/?p=pyderasn.git;a=blobdiff_plain;f=tests%2Ftest_pyderasn.py;h=50f181d3ac89be5d4eaade340647a541db699354;hp=f31967375c2f0e123051ebed97f071941ce22367;hb=b54295efb44566cd7eb6b09a4d5366f82cb96441;hpb=c6cf876ed3979538eeb0f0df60512c3feedb4715 diff --git a/tests/test_pyderasn.py b/tests/test_pyderasn.py index f319673..50f181d 100644 --- a/tests/test_pyderasn.py +++ b/tests/test_pyderasn.py @@ -1,6 +1,6 @@ # coding: utf-8 # PyDERASN -- Python ASN.1 DER/CER/BER codec with abstract structures -# Copyright (C) 2017-2021 Sergey Matveev +# Copyright (C) 2017-2022 Sergey Matveev # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as @@ -34,7 +34,6 @@ from time import time from unittest import TestCase from unittest.mock import patch -from dateutil.tz import tzutc from dateutil.tz import UTC from hypothesis import assume from hypothesis import given @@ -5065,15 +5064,12 @@ class TestUTCTime(TimeMixin, CommonMixin, TestCase): UTCTime(datetime(2000, 1, 1, 1, tzinfo=UTC)) def test_raises_if_no_dateutil(self): - with patch("pyderasn.tzutc", new=None): - with self.assertRaisesRegex( - NotImplementedError, - "Package python-dateutil is required to use this feature", - ): + with patch("pyderasn.tzUTC", new="missing"): + with self.assertRaisesRegex(NotImplementedError, "dateutil"): UTCTime(datetime.now()).totzdatetime() def test_tzinfo_gives_datetime_with_tzutc_tzinfo(self): - self.assertEqual(UTCTime(datetime.now()).totzdatetime().tzinfo, tzutc()) + self.assertEqual(UTCTime(datetime.now()).totzdatetime().tzinfo, UTC) @composite