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
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
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):