Skip to content

Commit

Permalink
lintage
Browse files Browse the repository at this point in the history
Signed-off-by: William Woodruff <[email protected]>
  • Loading branch information
woodruffw committed Nov 13, 2023
1 parent 58faa83 commit 6a555cf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
10 changes: 6 additions & 4 deletions limbo/testcases/webpki/topsites.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,20 @@
]


def _rename(name: str):
def _rename(name: str) -> Callable:
def deco(f: Callable) -> Callable:
f.__name__ = name
return f

return deco


def build_testcases():
def build_testcases() -> None:
for site in _TOPSITES:

@testcase
@_rename(site)
def _(builder: Builder):
def _(builder: Builder) -> None:
# TODO: Figure out the docstring here at some point.
ctx = SSL.Context(method=SSL.TLS_METHOD)
ctx.load_verify_locations(cafile=certifi.where())
Expand All @@ -48,7 +48,9 @@ def _(builder: Builder):
conn.connect((site, 443))
conn.do_handshake()

peer_chain = [Certificate(c.to_cryptography()) for c in conn.get_verified_chain()]
peer_chain = [
Certificate(c.to_cryptography()) for c in (conn.get_verified_chain() or [])
]

builder = (
builder.server_validation()
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ lint = [
"ruff < 0.1.6",
"mypy >= 1.0",
"types-pyyaml",
"types-pyOpenSSL",
]
doc = []
test = []
Expand Down

0 comments on commit 6a555cf

Please sign in to comment.