diff options
Diffstat (limited to 'testsuite/Testsrc/Testlib')
-rw-r--r-- | testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestProperties.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestProperties.py b/testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestProperties.py index 78cb5f52d..2fff67f8b 100644 --- a/testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestProperties.py +++ b/testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestProperties.py @@ -256,7 +256,7 @@ class TestXMLPropertyFile(TestPropertyFile, TestStructFile): pf._decrypt = Mock() pf._decrypt.return_value = 'plaintext' pf.data = ''' -<Properties encryption="true"> +<Properties encryption="true" decrypt="strict"> <Crypted encrypted="foo"> crypted <Plain foo="bar">plain</Plain> @@ -275,11 +275,18 @@ class TestXMLPropertyFile(TestPropertyFile, TestStructFile): for el in pf.xdata.xpath("//Crypted"): self.assertEqual(el.text, pf._decrypt.return_value) - # test failed decryption + # test failed decryption, strict pf._decrypt.reset_mock() pf._decrypt.side_effect = EVPError self.assertRaises(PluginExecutionError, pf.Index) + # test failed decryption, lax + pf.data = pf.data.replace("strict", "lax") + pf._decrypt.reset_mock() + pf.Index() + self.assertItemsEqual(pf._decrypt.call_args_list, + [call(el) for el in pf.xdata.xpath("//Crypted")]) + @skipUnless(HAS_CRYPTO, "No crypto libraries found, skipping") def test_decrypt(self): |