summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test_bigfile.py4
-rw-r--r--tests/test_common.py8
-rw-r--r--tests/test_compat.py4
-rw-r--r--tests/test_integers.py4
-rw-r--r--tests/test_load_save_keys.py6
-rw-r--r--tests/test_pem.py4
-rw-r--r--tests/test_pkcs1.py6
-rw-r--r--tests/test_strings.py4
-rw-r--r--tests/test_transform.py4
9 files changed, 22 insertions, 22 deletions
diff --git a/tests/test_bigfile.py b/tests/test_bigfile.py
index 6c3de00..b45b52f 100644
--- a/tests/test_bigfile.py
+++ b/tests/test_bigfile.py
@@ -21,12 +21,12 @@ try:
from StringIO import StringIO as BytesIO
except ImportError:
from io import BytesIO
-import unittest2
+import unittest
import rsa
from rsa import bigfile, varblock, pkcs1
-class BigfileTest(unittest2.TestCase):
+class BigfileTest(unittest.TestCase):
def test_encrypt_decrypt_bigfile(self):
diff --git a/tests/test_common.py b/tests/test_common.py
index eba5d27..a563d21 100644
--- a/tests/test_common.py
+++ b/tests/test_common.py
@@ -15,13 +15,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import unittest2
+import unittest
import struct
from rsa._compat import byte, b
from rsa.common import byte_size, bit_size, _bit_size
-class Test_byte(unittest2.TestCase):
+class Test_byte(unittest.TestCase):
def test_values(self):
self.assertEqual(byte(0), b('\x00'))
self.assertEqual(byte(255), b('\xff'))
@@ -30,7 +30,7 @@ class Test_byte(unittest2.TestCase):
self.assertRaises(struct.error, byte, 256)
self.assertRaises(struct.error, byte, -1)
-class Test_byte_size(unittest2.TestCase):
+class Test_byte_size(unittest.TestCase):
def test_values(self):
self.assertEqual(byte_size(1 << 1023), 128)
self.assertEqual(byte_size((1 << 1024) - 1), 128)
@@ -55,7 +55,7 @@ class Test_byte_size(unittest2.TestCase):
self.assertRaises(TypeError, byte_size, "")
self.assertRaises(TypeError, byte_size, None)
-class Test_bit_size(unittest2.TestCase):
+class Test_bit_size(unittest.TestCase):
def test_zero(self):
self.assertEqual(bit_size(0), 0)
diff --git a/tests/test_compat.py b/tests/test_compat.py
index 1788ff0..2ab7fd2 100644
--- a/tests/test_compat.py
+++ b/tests/test_compat.py
@@ -14,12 +14,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import unittest2
+import unittest
import struct
from rsa._compat import is_bytes, byte
-class Test_byte(unittest2.TestCase):
+class Test_byte(unittest.TestCase):
def test_byte(self):
for i in range(256):
byt = byte(i)
diff --git a/tests/test_integers.py b/tests/test_integers.py
index f504e45..118204a 100644
--- a/tests/test_integers.py
+++ b/tests/test_integers.py
@@ -16,11 +16,11 @@
'''Tests integer operations.'''
-import unittest2
+import unittest
import rsa.core
-class IntegerTest(unittest2.TestCase):
+class IntegerTest(unittest.TestCase):
def setUp(self):
(self.pub, self.priv) = rsa.newkeys(64)
diff --git a/tests/test_load_save_keys.py b/tests/test_load_save_keys.py
index 1a4ee23..b2b4071 100644
--- a/tests/test_load_save_keys.py
+++ b/tests/test_load_save_keys.py
@@ -17,7 +17,7 @@
'''Unittest for saving and loading keys.'''
import base64
-import unittest2
+import unittest
from rsa._compat import b
import rsa.key
@@ -69,7 +69,7 @@ CLEAN_PUBLIC_PEM = b('''\
''' % B64PUB_DER.decode("utf-8"))
-class DerTest(unittest2.TestCase):
+class DerTest(unittest.TestCase):
'''Test saving and loading DER keys.'''
def test_load_private_key(self):
@@ -104,7 +104,7 @@ class DerTest(unittest2.TestCase):
self.assertEqual(PUBLIC_DER, der)
-class PemTest(unittest2.TestCase):
+class PemTest(unittest.TestCase):
'''Test saving and loading PEM keys.'''
diff --git a/tests/test_pem.py b/tests/test_pem.py
index d1dcf3a..de1b8a6 100644
--- a/tests/test_pem.py
+++ b/tests/test_pem.py
@@ -15,12 +15,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import unittest2
+import unittest
from rsa._compat import b
from rsa.pem import _markers
-class Test__markers(unittest2.TestCase):
+class Test__markers(unittest.TestCase):
def test_values(self):
self.assertEqual(_markers('RSA PRIVATE KEY'),
(b('-----BEGIN RSA PRIVATE KEY-----'),
diff --git a/tests/test_pkcs1.py b/tests/test_pkcs1.py
index 6150215..7b92197 100644
--- a/tests/test_pkcs1.py
+++ b/tests/test_pkcs1.py
@@ -17,13 +17,13 @@
'''Tests string operations.'''
import struct
-import unittest2
+import unittest
import rsa
from rsa import pkcs1
from rsa._compat import byte, is_integer, b, is_bytes
-class BinaryTest(unittest2.TestCase):
+class BinaryTest(unittest.TestCase):
def setUp(self):
(self.pub, self.priv) = rsa.newkeys(256)
@@ -66,7 +66,7 @@ class BinaryTest(unittest2.TestCase):
self.assertNotEqual(encrypted1, encrypted2)
-class SignatureTest(unittest2.TestCase):
+class SignatureTest(unittest.TestCase):
def setUp(self):
(self.pub, self.priv) = rsa.newkeys(512)
diff --git a/tests/test_strings.py b/tests/test_strings.py
index fe60055..c4ee4c4 100644
--- a/tests/test_strings.py
+++ b/tests/test_strings.py
@@ -18,13 +18,13 @@
from __future__ import absolute_import
-import unittest2
+import unittest
import rsa
from constants import unicode_string
-class StringTest(unittest2.TestCase):
+class StringTest(unittest.TestCase):
def setUp(self):
(self.pub, self.priv) = rsa.newkeys(384)
diff --git a/tests/test_transform.py b/tests/test_transform.py
index ed3e38b..f919b1b 100644
--- a/tests/test_transform.py
+++ b/tests/test_transform.py
@@ -14,12 +14,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import unittest2
+import unittest
from rsa._compat import b
from rsa.transform import int2bytes, bytes2int, _int2bytes
-class Test_int2bytes(unittest2.TestCase):
+class Test_int2bytes(unittest.TestCase):
def test_accuracy(self):
self.assertEqual(int2bytes(123456789), b('\x07[\xcd\x15'))
self.assertEqual(_int2bytes(123456789), b('\x07[\xcd\x15'))