From 6c3ee5acde161348c08750f65b33e92537013c38 Mon Sep 17 00:00:00 2001 From: Sefik Ilkin Serengil Date: Fri, 20 May 2022 16:49:38 +0100 Subject: [PATCH] test coverage --- tests/unit_tests.py | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/tests/unit_tests.py b/tests/unit_tests.py index b6c01e2..57a71de 100644 --- a/tests/unit_tests.py +++ b/tests/unit_tests.py @@ -19,9 +19,8 @@ print("Running unit tests for TF ", tf.__version__) print("-----------------------------------------") -test_threshold = 97 -num_cases = 0 -succeed_cases = 0 +expected_coverage = 97 +num_cases = 0; succeed_cases = 0 def evaluate(condition): @@ -82,7 +81,7 @@ def test_cases(): print("-----------------------------------------") - print("Single find function test") + print("Find function test") df = DeepFace.find(img_path = "dataset/img1.jpg", db_path = "dataset") print(df.head()) @@ -170,10 +169,8 @@ def test_cases(): print("--------------------------") - #----------------------------------------- - - print("--------------------------") - + # ----------------------------------------- + print("Passing numpy array to analyze function") img = cv2.imread("dataset/img1.jpg") @@ -218,9 +215,9 @@ test_score = (100 * succeed_cases) / num_cases print("test coverage: " + str(test_score)) -if test_score > test_threshold: - print("min required test coverage is satisfied") +if test_score > expected_coverage: + print("well done! min required test coverage is satisfied") else: print("min required test coverage is NOT satisfied") -assert test_score > test_threshold \ No newline at end of file +assert test_score > expected_coverage \ No newline at end of file