2021-09-28 16:44:52 -04:00
|
|
|
from checkcert.checkcert import main as cert_main
|
|
|
|
from checkcert.checkcert import __version__ as cert_version
|
|
|
|
from click.testing import CliRunner
|
|
|
|
|
|
|
|
runner = CliRunner()
|
|
|
|
|
|
|
|
|
|
|
|
def test_main():
|
|
|
|
if cert_main:
|
|
|
|
response = runner.invoke(cert_main, ["www.franklin.edu"])
|
|
|
|
assert response.exit_code == 0
|
2021-09-28 16:52:14 -04:00
|
|
|
response = runner.invoke(cert_main, ["www.franklin.edu:443"])
|
|
|
|
assert response.exit_code == 0
|
2021-09-30 16:23:00 -04:00
|
|
|
response = runner.invoke(cert_main, ["www.franklin.edu", "--no-color"])
|
|
|
|
assert response.exit_code == 0
|
2021-09-28 16:44:52 -04:00
|
|
|
|
|
|
|
|
|
|
|
def test_version():
|
|
|
|
response = runner.invoke(cert_main, ["--version"])
|
|
|
|
assert response.exit_code == 0
|
|
|
|
assert cert_version in response.output
|
2021-09-28 16:52:14 -04:00
|
|
|
|
|
|
|
|
|
|
|
def test_dump():
|
|
|
|
response = runner.invoke(cert_main, ["www.franklin.edu", "--dump"])
|
|
|
|
assert response.exit_code == 0
|
|
|
|
|
|
|
|
|
|
|
|
def test_san():
|
|
|
|
response = runner.invoke(cert_main, ["www.franklin.edu", "--san"])
|
|
|
|
assert response.exit_code == 0
|
2021-09-30 16:23:00 -04:00
|
|
|
|
|
|
|
|
|
|
|
def test_bad_cert():
|
|
|
|
response = runner.invoke(cert_main, ["support.bluequill.com", "--san"])
|
|
|
|
assert response.exit_code == 0
|