Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/tests/test_rfc6030.doctest
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2016-03-19 20:02:49 +0100
committerArthur de Jong <arthur@arthurdejong.org>2016-03-19 20:51:14 +0100
commitcadc6d94c8875ebaf8f1d4c400d788a059d76416 (patch)
tree87dfc69c21a1af15c4817c03cfcc27c9d6592cf2 /tests/test_rfc6030.doctest
parentb8905e0b2d995e46190c30f8c7525839036a92d5 (diff)
Improve tests and test coverage
This adds tests to ensure that incorrect attribute and value types in the PSKC file raise a ValueError exception and extends the tests for invalid encryption options. This removes some code or adds no cover directives to a few places that have unreachable code or are Python version specific and places doctest directives inside the doctests where needed.
Diffstat (limited to 'tests/test_rfc6030.doctest')
-rw-r--r--tests/test_rfc6030.doctest16
1 files changed, 14 insertions, 2 deletions
diff --git a/tests/test_rfc6030.doctest b/tests/test_rfc6030.doctest
index 98b276d..634e1c7 100644
--- a/tests/test_rfc6030.doctest
+++ b/tests/test_rfc6030.doctest
@@ -1,6 +1,6 @@
test_rfc6030.doctest - test for examples from RFC 6030
-Copyright (C) 2014-2015 Arthur de Jong
+Copyright (C) 2014-2016 Arthur de Jong
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -155,7 +155,7 @@ encryption.
>>> key = pskc.keys[0]
>>> key.id
'12345678'
->>> key.secret
+>>> key.secret # doctest: +IGNORE_EXCEPTION_DETAIL
Traceback (most recent call last):
...
DecryptionError: No key available
@@ -168,6 +168,12 @@ DecryptionError: No key available
'3132333435363738393031323334353637383930'
>>> key.check()
True
+>>> key.algorithm
+'urn:ietf:params:xml:ns:keyprov:pskc:hotp'
+>>> key.response_length
+8
+>>> key.manufacturer
+'Manufacturer'
This tests a derived master key using PBKDF2 as seen in Figure 7 from RFC
@@ -186,6 +192,12 @@ This tests a derived master key using PBKDF2 as seen in Figure 7 from RFC
'12345678901234567890'
>>> key.check()
True
+>>> key.algorithm
+'urn:ietf:params:xml:ns:keyprov:pskc:hotp'
+>>> key.response_length
+8
+>>> key.manufacturer
+'TokenVendorAcme'
This tests bulk provisioning as shown in Figure 10 From RFC 6030.