How to use the tftest.TerraformTest function in tftest

To help you get started, we’ve selected a few tftest examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github GoogleCloudPlatform / terraform-python-testing-helper / test / test_files.py View on Github external
def test_setup_files():
  with tempfile.TemporaryDirectory() as tmpdir:
    with tempfile.NamedTemporaryFile() as tmpfile:
      tf = tftest.TerraformTest(tmpdir)
      tf.setup(extra_files=[tmpfile.name])
      assert os.path.exists(os.path.join(
          tmpdir, os.path.basename(tmpfile.name)))
      tf = None
      assert not os.path.exists(os.path.join(
          tmpdir, os.path.basename(tmpfile.name)))