aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwbond <will@wbond.net>2020-07-25 10:52:29 -0400
committerwbond <will@wbond.net>2020-07-25 10:52:29 -0400
commitc2552469c04bc6e5326bcd03603169b156108043 (patch)
treea346423b01f4835fa692c4840235d754d9aba650
parentc79ce16b194c5592ab2f45bb9f5052b614a607a1 (diff)
downloadasn1crypto-c2552469c04bc6e5326bcd03603169b156108043.tar.gz
Fix keys.PublicKeyInfo.bit_size tests on Python 2.6
-rw-r--r--tests/test_keys.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/test_keys.py b/tests/test_keys.py
index cfdfa0b..eefd48f 100644
--- a/tests/test_keys.py
+++ b/tests/test_keys.py
@@ -13,9 +13,9 @@ from ._unittest_compat import patch
patch()
if sys.version_info < (3,):
- num_cls = long # noqa
+ int_types = (int, long) # noqa
else:
- num_cls = int
+ int_types = int
tests_root = os.path.dirname(__file__)
fixtures_dir = os.path.join(tests_root, 'fixtures')
@@ -487,9 +487,9 @@ class KeysTests(unittest.TestCase):
with open(os.path.join(fixtures_dir, public_key_file), 'rb') as f:
public_key = keys.PublicKeyInfo.load(f.read())
- self.assertIsInstance(private_key.bit_size, num_cls)
+ self.assertIsInstance(private_key.bit_size, int_types)
self.assertEqual(bit_size, private_key.bit_size)
- self.assertIsInstance(public_key.bit_size, num_cls)
+ self.assertIsInstance(public_key.bit_size, int_types)
self.assertEqual(bit_size, public_key.bit_size)
@staticmethod