aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hazmat
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2014-01-24 12:19:05 -0600
committerAlex Gaynor <alex.gaynor@gmail.com>2014-01-24 12:19:05 -0600
commit0d62fb05a9203398510b2f0a6c940daab640f1d4 (patch)
tree749debfab745b588b1a986507b4216b570280daa /tests/hazmat
parentbb41bf4d798a6761889ea828f7d7f160f17b4132 (diff)
downloadcryptography-0d62fb05a9203398510b2f0a6c940daab640f1d4.tar.gz
cryptography-0d62fb05a9203398510b2f0a6c940daab640f1d4.tar.bz2
cryptography-0d62fb05a9203398510b2f0a6c940daab640f1d4.zip
Switch to using our own InternalError, instead of SystemError
Diffstat (limited to 'tests/hazmat')
-rw-r--r--tests/hazmat/backends/test_commoncrypto.py6
-rw-r--r--tests/hazmat/backends/test_openssl.py10
2 files changed, 8 insertions, 8 deletions
diff --git a/tests/hazmat/backends/test_commoncrypto.py b/tests/hazmat/backends/test_commoncrypto.py
index cfa332d0..7cc0f72f 100644
--- a/tests/hazmat/backends/test_commoncrypto.py
+++ b/tests/hazmat/backends/test_commoncrypto.py
@@ -14,7 +14,7 @@
import pytest
from cryptography import utils
-from cryptography.exceptions import UnsupportedAlgorithm
+from cryptography.exceptions import UnsupportedAlgorithm, InternalError
from cryptography.hazmat.bindings.commoncrypto.binding import Binding
from cryptography.hazmat.primitives import interfaces
from cryptography.hazmat.primitives.ciphers.algorithms import AES
@@ -49,10 +49,10 @@ class TestCommonCrypto(object):
with pytest.raises(ValueError):
backend._check_response(backend._lib.kCCAlignmentError)
- with pytest.raises(SystemError):
+ with pytest.raises(InternalError):
backend._check_response(backend._lib.kCCMemoryFailure)
- with pytest.raises(SystemError):
+ with pytest.raises(InternalError):
backend._check_response(backend._lib.kCCDecodeError)
def test_nonexistent_aead_cipher(self):
diff --git a/tests/hazmat/backends/test_openssl.py b/tests/hazmat/backends/test_openssl.py
index 2a329920..f01c3f64 100644
--- a/tests/hazmat/backends/test_openssl.py
+++ b/tests/hazmat/backends/test_openssl.py
@@ -14,7 +14,7 @@
import pytest
from cryptography import utils
-from cryptography.exceptions import UnsupportedAlgorithm
+from cryptography.exceptions import UnsupportedAlgorithm, InternalError
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.backends.openssl.backend import backend, Backend
from cryptography.hazmat.primitives import interfaces
@@ -76,20 +76,20 @@ class TestOpenSSL(object):
cipher.encryptor()
def test_handle_unknown_error(self):
- with pytest.raises(SystemError):
+ with pytest.raises(InternalError):
backend._handle_error_code(0, 0, 0)
- with pytest.raises(SystemError):
+ with pytest.raises(InternalError):
backend._handle_error_code(backend._lib.ERR_LIB_EVP, 0, 0)
- with pytest.raises(SystemError):
+ with pytest.raises(InternalError):
backend._handle_error_code(
backend._lib.ERR_LIB_EVP,
backend._lib.EVP_F_EVP_ENCRYPTFINAL_EX,
0
)
- with pytest.raises(SystemError):
+ with pytest.raises(InternalError):
backend._handle_error_code(
backend._lib.ERR_LIB_EVP,
backend._lib.EVP_F_EVP_DECRYPTFINAL_EX,