aboutsummaryrefslogtreecommitdiff
path: root/tests/type/test_useful.py
diff options
context:
space:
mode:
authorIlya Etingof <etingof@gmail.com>2017-07-13 23:17:46 +0200
committerIlya Etingof <etingof@gmail.com>2017-07-13 23:17:46 +0200
commit0a0d3c99becf149f0e4ad24768420122c2eeb3e5 (patch)
tree376476c3d774ef5634c77fd44280a711e29f1f5b /tests/type/test_useful.py
parent5f0f1e87a412909dde80d6d063b87b3dfb7c30fa (diff)
downloadpyasn1-0a0d3c99becf149f0e4ad24768420122c2eeb3e5.tar.gz
WIP: time types <-> datetime
Diffstat (limited to 'tests/type/test_useful.py')
-rw-r--r--tests/type/test_useful.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/type/test_useful.py b/tests/type/test_useful.py
index d416459..74d9fb1 100644
--- a/tests/type/test_useful.py
+++ b/tests/type/test_useful.py
@@ -40,19 +40,20 @@ class ObjectDescriptorTestCase(unittest.TestCase):
class GeneralizedTimeTestCase(unittest.TestCase):
def testFromDateTime(self):
- assert useful.GeneralizedTime.fromDateTime(datetime.datetime(2017, 07, 11, 0, 1, 2, 30000, tzinfo=UTC)) == '20170711000102.3Z'
+ assert useful.GeneralizedTime.fromDateTime(datetime.datetime(2017, 7, 11, 0, 1, 2, 30000, tzinfo=UTC)) == '20170711000102.3Z'
def testToDateTime(self):
- assert datetime.datetime(2017, 07, 11, 0, 1, 2, 30000, tzinfo=UTC) == useful.GeneralizedTime('20170711000102.3Z').asDateTime
+ assert datetime.datetime(2017, 7, 11, 0, 1, 2, 30000, tzinfo=UTC) == useful.GeneralizedTime('20170711000102.3Z').asDateTime
class UTCTimeTestCase(unittest.TestCase):
+
def testFromDateTime(self):
- assert useful.UTCTime.fromDateTime(datetime.datetime(2017, 07, 11, 0, 1, 2, 3, tzinfo=UTC)) == '2017071100010203,4+0000'
+ assert useful.UTCTime.fromDateTime(datetime.datetime(2017, 7, 11, 0, 1, 2, 30000, tzinfo=UTC)) == '20170711000102.3Z'
def testToDateTime(self):
- assert datetime.datetime(2017, 07, 11, 0, 1, 2, 3, tzinfo=UTC) == useful.UTCTime('2017071100010203,4+0000')
+ assert datetime.datetime(2017, 7, 11, 0, 1, 2, 30000, tzinfo=UTC) == useful.UTCTime('20170711000102.3Z').asDateTime
suite = unittest.TestLoader().loadTestsFromModule(sys.modules[__name__])