docs: add rough intro to test rtd integration

This commit is contained in:
Alex Kelly 2021-10-04 12:09:35 -04:00
parent f21cf8b100
commit 667e1c174e
3 changed files with 19 additions and 2 deletions

View file

@ -141,7 +141,10 @@ def main(san, dump, color, filename, valid, san_only, sep, pre, hosts):
output_string = ""
if pre:
output_string += f"{sep}".lstrip()
output_string += f"{sep}".join(get_alt_names(hostinfo.cert))
alt_names = get_alt_names(hostinfo.cert)
if hostinfo.hostname not in alt_names:
alt_names.insert(0, hostinfo.hostname)
output_string += f"{sep}".join(alt_names)
print(output_string)
break
output_string += (

View file

@ -10,6 +10,8 @@ Welcome to checkcert's documentation!
:maxdepth: 2
:caption: Contents:
introduction
Indices and tables

View file

@ -50,7 +50,19 @@ def test_san():
def test_san_only():
"""verify --san outputs correctly"""
response = runner.invoke(cert_main, ["www.franklin.edu", "--san-only"])
check_domain = "franklin.edu"
response = runner.invoke(cert_main, ["--san-only", check_domain])
assert response.exit_code == 0
sep_string = ","
response = runner.invoke(
cert_main, ["--san-only", f"--sep={sep_string}", check_domain]
)
assert response.exit_code == 0
assert sep_string in response.output
sep_string = " -d "
response = runner.invoke(
cert_main, ["--san-only", f"--sep={sep_string}", check_domain]
)
assert response.exit_code == 0