test: add base coverage for all functions

This commit is contained in:
Alex Kelly 2021-09-28 16:52:14 -04:00
parent 4b9ae5ff3f
commit d2a3a505fb
3 changed files with 14 additions and 2 deletions

View file

@ -1,6 +1,6 @@
[run]
source =
YOUR_SOURCE
checkcert
omit =
*/__init__.py

View file

@ -38,4 +38,4 @@ def main(san, dump, port, expires, domain):
if __name__ == "__main__":
main()
main() # pragma: no cover

View file

@ -9,9 +9,21 @@ def test_main():
if cert_main:
response = runner.invoke(cert_main, ["www.franklin.edu"])
assert response.exit_code == 0
response = runner.invoke(cert_main, ["www.franklin.edu:443"])
assert response.exit_code == 0
def test_version():
response = runner.invoke(cert_main, ["--version"])
assert response.exit_code == 0
assert cert_version in response.output
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