# Path: asn1crypto/util.py
#     def int_to_bytes(value, signed=False, width=None):
#     def int_from_bytes(value, signed=False):
#         def __init__(self, offset, name=None):
#         def __eq__(self, other):
#         def __getinitargs__(self):
#         def tzname(self, dt):
#         def utcoffset(self, dt):
#         def dst(self, dt):
#     def int_to_bytes(value, signed=False, width=None):
#     def int_from_bytes(value, signed=False):
# def _format_offset(off):
#     def tzname(self, dt):
#     def utcoffset(self, dt):
#     def dst(self, dt):
# def create_timezone(offset):
#     def __init__(self, year, month, day):
#     def year(self):
#     def month(self):
#     def day(self):
#     def strftime(self, format):
#     def isoformat(self):
#     def replace(self, year=None, month=None, day=None):
#     def __str__(self):
#     def __eq__(self, other):
#     def __ne__(self, other):
#     def _comparison_error(self, other):
#     def __cmp__(self, other):
#     def __lt__(self, other):
#     def __le__(self, other):
#     def __gt__(self, other):
#     def __ge__(self, other):
#     def __init__(self, year, *args, **kwargs):
#     def year(self):
#     def month(self):
#     def day(self):
#     def hour(self):
#     def minute(self):
#     def second(self):
#     def microsecond(self):
#     def tzinfo(self):
#     def utcoffset(self):
#     def time(self):
#     def date(self):
#     def strftime(self, format):
#     def isoformat(self, sep='T'):
#     def replace(self, year=None, *args, **kwargs):
#     def astimezone(self, tz):
#     def timestamp(self):
#     def __str__(self):
#     def __eq__(self, other):
#     def __ne__(self, other):
#     def _comparison_error(self, other):
#     def __cmp__(self, other):
#     def __lt__(self, other):
#     def __le__(self, other):
#     def __gt__(self, other):
#     def __ge__(self, other):
#     def __add__(self, other):
#     def __sub__(self, other):
#     def __rsub__(self, other):
#     def from_y2k(cls, value):
#     class timezone(tzinfo):  # noqa
# class _UtcWithDst(tzinfo):
# class extended_date(object):
# class extended_datetime(object):
#     DAYS_IN_400_YEARS = 400 * 365 + 97
#     DAYS_IN_2000_YEARS = 5 * DAYS_IN_400_YEARS


import os
import platform
import sys
import unittest
from datetime import date, datetime, time, timedelta
from asn1crypto import util
from .unittest_data import data_decorator
from ._unittest_compat import patch
        self.assertEqual(ext_dt + timedelta(hours=20), datetime(1, 1, 1, 5, 17, 45, 14889, zone))
        self.assertEqual(ext_dt - timedelta(hours=20), util.extended_datetime(0, 12, 30, 13, 17, 45, 14889, zone))
        self.assertEqual(ext_dt - ext_dt, timedelta(0))

        zone2 = util.create_timezone(timedelta(hours=-8, minutes=-31))
        ext_dt2 = util.extended_datetime(0, 11, 14, 13, 44, 20, 876543, zone2)
        expected_diff = timedelta(days=47, hours=-4, minutes=-27, seconds=25, microseconds=-861654)
        expected_diff -= timedelta(hours=20, minutes=76)
        self.assertEqual(ext_dt - ext_dt2, expected_diff)

        dt = datetime(400, 12, 31, 9, 17, 45, 14889, zone)
        self.assertEqual(dt - ext_dt, timedelta(days=util.extended_datetime.DAYS_IN_400_YEARS))
        self.assertEqual(ext_dt - dt, -timedelta(days=util.extended_datetime.DAYS_IN_400_YEARS))

        with self.assertRaises(TypeError):
            ext_dt - "test"

    def test_extended_datetime_compare_tzinfo(self):
        with self.assertRaises(TypeError):
            self.assertTrue(util.extended_datetime(0, 1, 1, tzinfo=utc) < datetime(1, 1, 1))
        with self.assertRaises(TypeError):
            self.assertTrue(util.extended_datetime(0, 1, 1) < datetime(1, 1, 1, tzinfo=utc))

    def test_extended_datetime_date_time(self):
        self.assertEqual(util.extended_date(0, 1, 1), util.extended_datetime(0, 1, 1).date())
        self.assertEqual(util.extended_date(0, 2, 29), util.extended_datetime(0, 2, 29).date())
        self.assertEqual(time(0, 0, 0), util.extended_datetime(0, 1, 1).time())

    def test_iri_to_uri(self):
        self.assertEqual(

# Path: asn1crypto/util.py
#     def int_to_bytes(value, signed=False, width=None):
#     def int_from_bytes(value, signed=False):
#         def __init__(self, offset, name=None):
#         def __eq__(self, other):
#         def __getinitargs__(self):
#         def tzname(self, dt):
#         def utcoffset(self, dt):
#         def dst(self, dt):
#     def int_to_bytes(value, signed=False, width=None):
#     def int_from_bytes(value, signed=False):
# def _format_offset(off):
#     def tzname(self, dt):
#     def utcoffset(self, dt):
#     def dst(self, dt):
# def create_timezone(offset):
#     def __init__(self, year, month, day):
#     def year(self):
#     def month(self):
#     def day(self):
#     def strftime(self, format):
#     def isoformat(self):
#     def replace(self, year=None, month=None, day=None):
#     def __str__(self):
#     def __eq__(self, other):
#     def __ne__(self, other):
#     def _comparison_error(self, other):
#     def __cmp__(self, other):
#     def __lt__(self, other):
#     def __le__(self, other):
#     def __gt__(self, other):
#     def __ge__(self, other):
#     def __init__(self, year, *args, **kwargs):
#     def year(self):
#     def month(self):
#     def day(self):
#     def hour(self):
#     def minute(self):
#     def second(self):
#     def microsecond(self):
#     def tzinfo(self):
#     def utcoffset(self):
#     def time(self):
#     def date(self):
#     def strftime(self, format):
#     def isoformat(self, sep='T'):
#     def replace(self, year=None, *args, **kwargs):
#     def astimezone(self, tz):
#     def timestamp(self):
#     def __str__(self):
#     def __eq__(self, other):
#     def __ne__(self, other):
#     def _comparison_error(self, other):
#     def __cmp__(self, other):
#     def __lt__(self, other):
#     def __le__(self, other):
#     def __gt__(self, other):
#     def __ge__(self, other):
#     def __add__(self, other):
#     def __sub__(self, other):
#     def __rsub__(self, other):
#     def from_y2k(cls, value):
#     class timezone(tzinfo):  # noqa
# class _UtcWithDst(tzinfo):
# class extended_date(object):
# class extended_datetime(object):
#     DAYS_IN_400_YEARS = 400 * 365 + 97
#     DAYS_IN_2000_YEARS = 5 * DAYS_IN_400_YEARS


# Path: tests/test_util.py
import os
import platform
import sys
import unittest
from datetime import date, datetime, time, timedelta
from asn1crypto import util
from .unittest_data import data_decorator
from ._unittest_compat import patch

        self.assertEqual(ext_dt + timedelta(hours=20), datetime(1, 1, 1, 5, 17, 45, 14889, zone))
        self.assertEqual(ext_dt - timedelta(hours=20), util.extended_datetime(0, 12, 30, 13, 17, 45, 14889, zone))
        self.assertEqual(ext_dt - ext_dt, timedelta(0))

        zone2 = util.create_timezone(timedelta(hours=-8, minutes=-31))
        ext_dt2 = util.extended_datetime(0, 11, 14, 13, 44, 20, 876543, zone2)
        expected_diff = timedelta(days=47, hours=-4, minutes=-27, seconds=25, microseconds=-861654)
        expected_diff -= timedelta(hours=20, minutes=76)
        self.assertEqual(ext_dt - ext_dt2, expected_diff)

        dt = datetime(400, 12, 31, 9, 17, 45, 14889, zone)
        self.assertEqual(dt - ext_dt, timedelta(days=util.extended_datetime.DAYS_IN_400_YEARS))
        self.assertEqual(ext_dt - dt, -timedelta(days=util.extended_datetime.DAYS_IN_400_YEARS))

        with self.assertRaises(TypeError):
            ext_dt - "test"

    def test_extended_datetime_compare_tzinfo(self):
        with self.assertRaises(TypeError):
            self.assertTrue(util.extended_datetime(0, 1, 1, tzinfo=utc) < datetime(1, 1, 1))
        with self.assertRaises(TypeError):
            self.assertTrue(util.extended_datetime(0, 1, 1) < datetime(1, 1, 1, tzinfo=utc))

    def test_extended_datetime_date_time(self):
        self.assertEqual(util.extended_date(0, 1, 1), util.extended_datetime(0, 1, 1).date())
        self.assertEqual(util.extended_date(0, 2, 29), util.extended_datetime(0, 2, 29).date())
        self.assertEqual(time(0, 0, 0), util.extended_datetime(0, 1, 1).time())

    def test_iri_to_uri(self):
        self.assertEqual(

            b'ldap://ldap.e-szigno.hu/CN=Microsec%20e-Szigno%20Root%20CA,OU=e-Szigno%20CA,'