From ef72dfb7ba6a26a2a2e29d346cb18a735071db3f Mon Sep 17 00:00:00 2001 From: Martin Aceto Date: Thu, 29 Feb 2024 13:26:28 -0500 Subject: [PATCH] delete old tests --- tests/test_report/libs/test_result.py | 32 --------------------------- tests/test_report/libs/test_utils.py | 29 ------------------------ tests/test_report/test_report_main.py | 0 3 files changed, 61 deletions(-) delete mode 100644 tests/test_report/libs/test_result.py delete mode 100644 tests/test_report/libs/test_utils.py delete mode 100644 tests/test_report/test_report_main.py diff --git a/tests/test_report/libs/test_result.py b/tests/test_report/libs/test_result.py deleted file mode 100644 index 2d3eefd..0000000 --- a/tests/test_report/libs/test_result.py +++ /dev/null @@ -1,32 +0,0 @@ -import pytest -from functions.report.libs.result import Result - -def test_success(): - r = Result(status="success") - assert r.success() == True - assert r.failure() == False - -def test_failure(): - r = Result(errors=["some error"]) - assert r.success() == False - assert r.failure() == True - -def test_default_status(): - r = Result() - assert r.status == "ok" - assert r.success() == True - assert r.failure() == False - -def test_custom_status(): - r = Result(status="custom") - assert r.status == "custom" - assert r.success() == True - assert r.failure() == False - -def test_result(): - r = Result(result="some result") - assert r.result == "some result" - -def test_errors(): - r = Result(errors=["some error"]) - assert r.errors == ["some error"] diff --git a/tests/test_report/libs/test_utils.py b/tests/test_report/libs/test_utils.py deleted file mode 100644 index bbcebda..0000000 --- a/tests/test_report/libs/test_utils.py +++ /dev/null @@ -1,29 +0,0 @@ -from functions.report.libs.utils import * -from functions.report.libs.result import Result -import json - -def test_output(): - # Create a mock result object with a successful status - result_success = Result(status="success", result={"message": "Hello, world!"}) - - # Call the output function with the mock result object - output_result_success = output(result_success) - - # Verify that the output has the correct HTTP status code and payload - assert output_result_success[1] == 200 - assert json.loads(output_result_success[0]) == {"message": "Hello, world!"} - - # Create a mock result object with an error status - result_error = Result(status="error", errors=[["param", "Invalid request"]]) - - # Call the output function with the mock result object - output_result_error = output(result_error) - - # Verify that the output has the correct HTTP status code and payload - assert output_result_error[1] == 400 - assert json.loads(output_result_error[0]) == [{"param": "Invalid request"}] - -def test_convert_to_hashes(): - input_arr = [["geo", "missing geo parameters"], ["app", "missing geo parameters"]] - expected_output_arr = [{'geo': 'missing geo parameters'}, {'app': 'missing geo parameters'}] - assert convert_to_hashes(input_arr) == expected_output_arr diff --git a/tests/test_report/test_report_main.py b/tests/test_report/test_report_main.py deleted file mode 100644 index e69de29..0000000