From 76ef42bf1009e542b90814dc0b629e0ee5b0356c Mon Sep 17 00:00:00 2001 From: Arthur de Jong Date: Thu, 29 May 2014 14:49:05 +0200 Subject: Add test for missing key encryption algorithm This also introduces a toplevel PSKCError exception that all exceptions have as parent. --- tests/invalid-encryption.pskcxml | 18 +++++++++++++++++- tests/test_invalid.doctest | 7 +++++++ 2 files changed, 24 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/invalid-encryption.pskcxml b/tests/invalid-encryption.pskcxml index 18ee5f1..d900dc9 100644 --- a/tests/invalid-encryption.pskcxml +++ b/tests/invalid-encryption.pskcxml @@ -2,7 +2,7 @@ +AAECAwQFBgcICQoLDA0OD+cIHItlB3Wra1DUpxVvOx2lef1VmNPCMl8jwZqIUqGv + + + + + + + + + + + + + + + AAECAwQFBgcICQoLDA0OD+cIHItlB3Wra1DUpxVvOx2lef1VmNPCMl8jwZqIUqGv diff --git a/tests/test_invalid.doctest b/tests/test_invalid.doctest index 2665bae..7c291e1 100644 --- a/tests/test_invalid.doctest +++ b/tests/test_invalid.doctest @@ -55,3 +55,10 @@ DecryptionError: No key available Traceback (most recent call last): ... DecryptionError: Unsupported algorithm: ... +>>> key = pskc.keys[1] +>>> key.id +'45678901' +>>> key.secret +Traceback (most recent call last): + ... +DecryptionError: No algorithm specified -- cgit v1.2.3