diff options
author | Matěj Cepl <mcepl@cepl.eu> | 2019-05-30 16:01:36 +0200 |
---|---|---|
committer | Matěj Cepl <mcepl@cepl.eu> | 2019-05-30 17:06:41 +0200 |
commit | f287d7145b5fd28f630f2b823ad45a44cf635b35 (patch) | |
tree | a8214586a745e2d2e864497805cde0b22cb315ac /tests/test_err.py | |
parent | 55d4e9542de3519fb0085da9abfd8e0b8eee0d7a (diff) | |
download | m2crypto-f287d7145b5fd28f630f2b823ad45a44cf635b35.tar.gz |
Be resilient against the situation when no erorr happened.
Fixes #258.
Diffstat (limited to 'tests/test_err.py')
-rw-r--r-- | tests/test_err.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/test_err.py b/tests/test_err.py new file mode 100644 index 0000000..05fe425 --- /dev/null +++ b/tests/test_err.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +"""Unit tests for M2Crypto.Err. + +Copyright (C) 2019 Matěj Cepl +Released under the terms of MIT/X11 License, +see the file LICENCE for more. +""" +from M2Crypto import Err +from tests import unittest + + +class ErrTestCase(unittest.TestCase): + + def test_no_error(self): + # Protection against gl#m2crypto/m2crypto#258 + self.assertEqual(Err.get_error_reason(0), '') + + + +def suite(): + suite = unittest.TestSuite() + suite.addTest(unittest.makeSuite(ErrTestCase)) + return suite + + +if __name__ == '__main__': + unittest.TextTestRunner().run(suite()) |