From d2a3a505fb48227443a20addd26ad397baaaccf9 Mon Sep 17 00:00:00 2001 From: Alex Kelly Date: Tue, 28 Sep 2021 16:52:14 -0400 Subject: [PATCH] test: add base coverage for all functions --- .coveragerc | 2 +- checkcert/checkcert.py | 2 +- tests/test_checkcert.py | 12 ++++++++++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.coveragerc b/.coveragerc index af62bf9..fc7055e 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,6 +1,6 @@ [run] source = - YOUR_SOURCE + checkcert omit = */__init__.py diff --git a/checkcert/checkcert.py b/checkcert/checkcert.py index 4900e97..4d8e637 100644 --- a/checkcert/checkcert.py +++ b/checkcert/checkcert.py @@ -38,4 +38,4 @@ def main(san, dump, port, expires, domain): if __name__ == "__main__": - main() + main() # pragma: no cover diff --git a/tests/test_checkcert.py b/tests/test_checkcert.py index 835a958..bc5d83c 100644 --- a/tests/test_checkcert.py +++ b/tests/test_checkcert.py @@ -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