X-Git-Url: http://www.git.cypherpunks.ru/?p=pyderasn.git;a=blobdiff_plain;f=tests%2Ftest_pyderasn.py;fp=tests%2Ftest_pyderasn.py;h=90d50e9597a0cab8f7f101b9fa5f93abd3ae647a;hp=8225fc02eaef4be07fc42093a3f28e4cbc88b933;hb=44e10c60d857ea5e631927ac4b23365cc3b80698;hpb=bba84f2f3b5fbc860f51cf76f2f504cb2aa8d899 diff --git a/tests/test_pyderasn.py b/tests/test_pyderasn.py index 8225fc0..90d50e9 100644 --- a/tests/test_pyderasn.py +++ b/tests/test_pyderasn.py @@ -33,6 +33,7 @@ from time import mktime from time import time from unittest import TestCase +from dateutil.tz import UTC from hypothesis import assume from hypothesis import given from hypothesis import settings @@ -4727,6 +4728,10 @@ class TestGeneralizedTime(TimeMixin, CommonMixin, TestCase): with self.assertRaises(DecodeError): GeneralizedTime(data) + def test_aware(self): + with assertRaisesRegex(self, ValueError, "only naive"): + GeneralizedTime(datetime(2000, 1, 1, 1, tzinfo=UTC)) + class TestUTCTime(TimeMixin, CommonMixin, TestCase): base_klass = UTCTime @@ -5060,6 +5065,10 @@ class TestUTCTime(TimeMixin, CommonMixin, TestCase): junk ) + def test_aware(self): + with assertRaisesRegex(self, ValueError, "only naive"): + UTCTime(datetime(2000, 1, 1, 1, tzinfo=UTC)) + @composite def tlv_value_strategy(draw):