This repository has been archived by the owner on Jul 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added initial tests for functions.py
- Loading branch information
Michael-Hilborn
committed
Jul 26, 2021
1 parent
9bf54a0
commit 728d590
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import pytest | ||
import os | ||
from io import StringIO | ||
from unittest.mock import patch | ||
from src.common import functions | ||
from src.common.functions import Color | ||
from src.common.functions import IntegrationInfo | ||
|
||
# def test_health_check(): | ||
# expected_out = Color.GREEN + "google.com has successfully been deployed." + Color.END | ||
# with patch('sys.stdout', new = StringIO()) as fake_out: | ||
# functions.healthCheck("www.cloud.ibm.com") | ||
# assert fake_out.getvalue() == expected_out | ||
|
||
def test_read_envfile(): | ||
test_integration = IntegrationInfo() | ||
test_integration.read_envfile("test_var.env") | ||
|
||
assert test_integration.app_url == "test_app_url.com" | ||
assert test_integration.cis_domain == "gcat-interns-test.com" | ||
assert test_integration.crn == "test_crn" | ||
assert test_integration.zone_id == "test_zone_id" | ||
assert test_integration.cis_api_key == "test_api_key" | ||
assert test_integration.api_endpoint == "www.test_api_endpoint.com" | ||
|
||
|
||
def test_terraform_read_envfile(): | ||
test_integration = IntegrationInfo() | ||
test_integration.terraforming = True | ||
test_integration.read_envfile("test_var.env") | ||
|
||
assert test_integration.app_url == "test_app_url.com" | ||
assert test_integration.cis_domain == "gcat-interns-test.com" | ||
assert test_integration.cis_api_key == "test_api_key" | ||
assert test_integration.api_endpoint == "www.test_api_endpoint.com" | ||
assert test_integration.resource_group == "test-resource-group" | ||
assert test_integration.cis_name == "test_instance_name" | ||
|
||
|