test: fix separator testing issues
test: add coverage for cert-not-in-san case
This commit is contained in:
parent
18a59afead
commit
c6d657952d
1 changed files with 11 additions and 4 deletions
|
@ -22,6 +22,8 @@ def test_main():
|
||||||
assert response.exit_code == 0
|
assert response.exit_code == 0
|
||||||
response = runner.invoke(cert_main, ["www.franklin.edu", "library.franklin.edu"])
|
response = runner.invoke(cert_main, ["www.franklin.edu", "library.franklin.edu"])
|
||||||
assert response.exit_code == 0
|
assert response.exit_code == 0
|
||||||
|
response = runner.invoke(cert_main, ["www.franklin.edu", "--valid"])
|
||||||
|
assert response.exit_code == 0
|
||||||
response = runner.invoke(
|
response = runner.invoke(
|
||||||
cert_main, ["www.franklin.edu:443", "library.franklin.edu"]
|
cert_main, ["www.franklin.edu:443", "library.franklin.edu"]
|
||||||
)
|
)
|
||||||
|
@ -50,20 +52,25 @@ def test_san():
|
||||||
|
|
||||||
def test_san_only():
|
def test_san_only():
|
||||||
"""verify --san outputs correctly"""
|
"""verify --san outputs correctly"""
|
||||||
check_domain = "franklin.edu"
|
check_domain = "example.com"
|
||||||
response = runner.invoke(cert_main, ["--san-only", check_domain])
|
response = runner.invoke(cert_main, ["--san-only", check_domain])
|
||||||
assert response.exit_code == 0
|
assert response.exit_code == 0
|
||||||
sep_string = ","
|
sep_string = ","
|
||||||
response = runner.invoke(
|
response = runner.invoke(
|
||||||
cert_main, ["--san-only", f"--sep={sep_string}", check_domain]
|
cert_main, ["--san-only", "--sep", sep_string, check_domain]
|
||||||
)
|
)
|
||||||
assert response.exit_code == 0
|
assert response.exit_code == 0
|
||||||
assert sep_string in response.output
|
assert sep_string in response.output
|
||||||
sep_string = " -d "
|
|
||||||
response = runner.invoke(
|
response = runner.invoke(
|
||||||
cert_main, ["--san-only", f"--sep={sep_string}", check_domain]
|
cert_main, ["--san-only", "--sep", sep_string, "--pre", check_domain]
|
||||||
)
|
)
|
||||||
assert response.exit_code == 0
|
assert response.exit_code == 0
|
||||||
|
assert response.output.startswith(sep_string)
|
||||||
|
response = runner.invoke(
|
||||||
|
cert_main, ["--san-only", "--sep", sep_string, "--pre", "cs.franklin.edu"]
|
||||||
|
)
|
||||||
|
assert response.exit_code == 0
|
||||||
|
assert response.output.startswith(sep_string)
|
||||||
|
|
||||||
|
|
||||||
def test_bad_cert():
|
def test_bad_cert():
|
||||||
|
|
Loading…
Reference in a new issue