Created
May 24, 2022 18:24
-
-
Save mehd-io/7f40f589b19581cf64f3fa655e7eadb5 to your computer and use it in GitHub Desktop.
medium-tftest-infra
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
import pytest | |
import tftest | |
from pathlib import Path | |
@pytest.fixture | |
def plan(): | |
file_path = Path(__file__).resolve() | |
base_dir = file_path.parent.parent.parent.absolute() | |
tf = tftest.TerraformTest(tfdir="terraform", basedir=base_dir) | |
tf.setup() | |
return tf.plan(output=True) | |
def test_outputs(plan): | |
"""Simple test of the output vars after a terraform plan cmd | |
""" | |
assert plan.outputs['cloud_run_api_image_name'] == f"{plan.variables['prefix']}-cloudrun-api" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment