aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Bastin <nick.bastin@gmail.com>2015-12-13 05:37:04 -0800
committerNick Bastin <nick.bastin@gmail.com>2015-12-13 05:37:04 -0800
commita7f504fcd61eda90456366a7c7bf608fd03f5d47 (patch)
treeeb95f2667eb616422e457ae9f55ec3bb59725452
parent74021e97f842b7b5843863bc988f39710a9258f4 (diff)
downloadcryptography-a7f504fcd61eda90456366a7c7bf608fd03f5d47.tar.gz
cryptography-a7f504fcd61eda90456366a7c7bf608fd03f5d47.tar.bz2
cryptography-a7f504fcd61eda90456366a7c7bf608fd03f5d47.zip
PEP8 fixes
-rw-r--r--src/cryptography/x509/extensions.py4
-rw-r--r--src/cryptography/x509/oid.py2
-rw-r--r--tests/test_x509_ext.py21
3 files changed, 18 insertions, 9 deletions
diff --git a/src/cryptography/x509/extensions.py b/src/cryptography/x509/extensions.py
index 97d78266..71ce8a15 100644
--- a/src/cryptography/x509/extensions.py
+++ b/src/cryptography/x509/extensions.py
@@ -18,9 +18,7 @@ from cryptography import utils
from cryptography.hazmat.primitives import constant_time, serialization
from cryptography.x509.general_name import GeneralName, IPAddress, OtherName
from cryptography.x509.name import Name
-from cryptography.x509.oid import (
- AuthorityInformationAccessOID, ExtensionOID, ObjectIdentifier
-)
+from cryptography.x509.oid import ExtensionOID, ObjectIdentifier
class _SubjectPublicKeyInfo(univ.Sequence):
diff --git a/src/cryptography/x509/oid.py b/src/cryptography/x509/oid.py
index 977d770f..f2d84d31 100644
--- a/src/cryptography/x509/oid.py
+++ b/src/cryptography/x509/oid.py
@@ -15,7 +15,7 @@ class ObjectIdentifier(object):
# Basic validation for being well-formed
for part in self._dotted_string.split("."):
try:
- val = int(part, 0)
+ int(part, 0)
except ValueError:
raise ValueError("Malformed OID: %s" % (self._dotted_string))
diff --git a/tests/test_x509_ext.py b/tests/test_x509_ext.py
index fbd8b882..bbdc6079 100644
--- a/tests/test_x509_ext.py
+++ b/tests/test_x509_ext.py
@@ -604,8 +604,14 @@ class TestAuthorityKeyIdentifier(object):
def test_authority_cert_serial_number_not_integer(self):
dirname = x509.DirectoryName(
x509.Name([
- x509.NameAttribute(x509.ObjectIdentifier('2.999.1'), u'value1'),
- x509.NameAttribute(x509.ObjectIdentifier('2.999.2'), u'value2'),
+ x509.NameAttribute(
+ x509.ObjectIdentifier('2.999.1'),
+ u'value1'
+ ),
+ x509.NameAttribute(
+ x509.ObjectIdentifier('2.999.2'),
+ u'value2'
+ ),
])
)
with pytest.raises(TypeError):
@@ -618,8 +624,14 @@ class TestAuthorityKeyIdentifier(object):
def test_authority_issuer_not_none_serial_none(self):
dirname = x509.DirectoryName(
x509.Name([
- x509.NameAttribute(x509.ObjectIdentifier('2.999.1'), u'value1'),
- x509.NameAttribute(x509.ObjectIdentifier('2.999.2'), u'value2'),
+ x509.NameAttribute(
+ x509.ObjectIdentifier('2.999.1'),
+ u'value1'
+ ),
+ x509.NameAttribute(
+ x509.ObjectIdentifier('2.999.2'),
+ u'value2'
+ ),
])
)
with pytest.raises(ValueError):
@@ -1849,7 +1861,6 @@ class TestExtendedKeyUsageExtension(object):
class TestAccessDescription(object):
def test_invalid_access_method(self):
- # access_method can be *any* valid OID
with pytest.raises(TypeError):
x509.AccessDescription("notanoid", x509.DNSName(u"test"))