Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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)))