Replace hidden files with custom python (#99)

Signed-off-by: Merwane Hamadi <merwanehamadi@gmail.com>
This commit is contained in:
merwanehamadi
2023-07-14 14:39:47 -07:00
committed by GitHub
parent a9702e4629
commit 7bc7d9213d
6 changed files with 23 additions and 28 deletions

View File

@@ -5,6 +5,15 @@ from unittest.mock import Mock, patch
import requests
def test_make_request_and_assert() -> None:
result = make_request_and_assert()
print(result)
expected_result = {"status": "OK"}
error_message = f"AssertionError: Expected the output to be {expected_result}"
print(error_message)
assert result == expected_result, error_message
def make_assertion() -> None:
if os.environ.get("MOCK_TEST", "False").lower() == "true":
mock_response = Mock(requests.Response)
@@ -25,3 +34,8 @@ def make_request_and_assert() -> Dict[str, Any]:
)
return response.json()
if __name__ == "__main__":
# test for the case when server is healthy
test_make_request_and_assert()