Skip to content

Commit 69444ab

Browse files
committed
Fix a few lint errors from 558cab0
1 parent de62489 commit 69444ab

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

python/ct/client/db/cert_desc.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ def process_name(subject, reverse=True):
8282
# allow letter-digit-hyphen, as well as wildcards (RFC 2818).
8383
forbidden = re.compile(r"[^a-z\d\-\*]")
8484
labels = subject.lower().split(".")
85-
valid_dns_name = len(labels) > 1 and all(map(lambda x: len(x) and not forbidden.search(x), labels))
85+
valid_dns_name = len(labels) > 1 and all(
86+
map(lambda x: len(x) and not forbidden.search(x), labels))
8687

8788
if valid_dns_name:
8889
# ["com", "example", "*"], ["com", "example", "mail"],

python/ct/client/db/cert_desc_test.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,19 @@ def test_from_cert(self):
6161
self.assertItemsEqual(proto_obs, observations_tuples)
6262

6363
def test_process_value(self):
64-
self.assertEqual(['London'], cert_desc.process_name('London'))
65-
self.assertEqual(['Bob Smith'], cert_desc.process_name('Bob Smith'))
66-
self.assertEqual(['com', 'googleapis', 'ct'], cert_desc.process_name('ct.googleapis.com'))
67-
self.assertEqual(['com', 'github'], cert_desc.process_name('gItHuB.CoM'))
64+
self.assertEqual(["London"], cert_desc.process_name("London"))
65+
self.assertEqual(["Bob Smith"], cert_desc.process_name("Bob Smith"))
66+
self.assertEqual(["com", "googleapis", "ct"],
67+
cert_desc.process_name("ct.googleapis.com"))
68+
self.assertEqual(["com", "github"],
69+
cert_desc.process_name("gItHuB.CoM"))
6870
# These two are unfortunate outcomes:
6971
# 1. single-word hostnames are indistinguishable from single-word CN
7072
# terms like State, City, Organization
71-
self.assertEqual(['LOCALhost'], cert_desc.process_name('LOCALhost'))
73+
self.assertEqual(["LOCALhost"], cert_desc.process_name("LOCALhost"))
7274
# 2. IP addresses should perhaps not be reversed like hostnames are
73-
self.assertEqual(['1', '0', '168', '192'], cert_desc.process_name('192.168.0.1'))
75+
self.assertEqual(["1", "0", "168", "192"],
76+
cert_desc.process_name("192.168.0.1"))
7477

7578
if __name__ == "__main__":
7679
unittest.main()

0 commit comments

Comments
 (0)