aboutsummaryrefslogtreecommitdiff
path: root/tests/type/test_useful.py
diff options
context:
space:
mode:
authorIlya Etingof <etingof@gmail.com>2017-09-15 16:55:16 +0200
committerIlya Etingof <etingof@gmail.com>2017-09-15 21:54:32 +0200
commite337ff621e43666fc707600c7601d154dd799d08 (patch)
tree89478769ad51608bc2404fc582cadcea94f1e68e /tests/type/test_useful.py
parent218acc52cd4574df07536e1bc81bc1eb7a410573 (diff)
downloadpyasn1-e337ff621e43666fc707600c7601d154dd799d08.tar.gz
run unit tests with full debugging enabled (and ignored)
Also fixed a couple of crashes in debug messages
Diffstat (limited to 'tests/type/test_useful.py')
-rw-r--r--tests/type/test_useful.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/type/test_useful.py b/tests/type/test_useful.py
index dbd6fe0..717eede 100644
--- a/tests/type/test_useful.py
+++ b/tests/type/test_useful.py
@@ -6,14 +6,16 @@
#
import sys
import datetime
-from pyasn1.type import useful
-from pyasn1.error import PyAsn1Error
try:
import unittest2 as unittest
+
except ImportError:
import unittest
+from tests.base import BaseTestCase
+
+from pyasn1.type import useful
class FixedOffset(datetime.tzinfo):
def __init__(self, offset, name):
@@ -34,11 +36,11 @@ UTC = FixedOffset(0, 'UTC')
UTC2 = FixedOffset(120, 'UTC')
-class ObjectDescriptorTestCase(unittest.TestCase):
+class ObjectDescriptorTestCase(BaseTestCase):
pass
-class GeneralizedTimeTestCase(unittest.TestCase):
+class GeneralizedTimeTestCase(BaseTestCase):
def testFromDateTime(self):
assert useful.GeneralizedTime.fromDateTime(datetime.datetime(2017, 7, 11, 0, 1, 2, 30000, tzinfo=UTC)) == '20170711000102.3Z'
@@ -71,7 +73,7 @@ class GeneralizedTimeTestCase(unittest.TestCase):
assert datetime.datetime(2017, 7, 11, 0) == useful.GeneralizedTime('2017071100').asDateTime
-class UTCTimeTestCase(unittest.TestCase):
+class UTCTimeTestCase(BaseTestCase):
def testFromDateTime(self):
assert useful.UTCTime.fromDateTime(datetime.datetime(2017, 7, 11, 0, 1, 2, tzinfo=UTC)) == '170711000102Z'