1313import pytest
1414import hcl2
1515
16+ # TODO set up the tests to run with tox so we can run the tests with different python versions
17+
1618
1719THIS_PATH = os .path .abspath (os .path .dirname (__file__ ))
1820ROOT_PATH = os .path .join (THIS_PATH , ".." )
@@ -294,6 +296,7 @@ def test_s3_backend_configs_merge(monkeypatch):
294296 encryption = true
295297 use_path_style = true
296298 acl = "bucket-owner-full-control"
299+ shared_config_files = ["~/.aws/config","~/other/config"]
297300 }
298301 }
299302 resource "aws_s3_bucket" "test-bucket" {
@@ -317,7 +320,9 @@ def check_override_file_backend_extra_content(override_file):
317320
318321 return result .get ("use_path_style" ) is True and \
319322 result .get ("encryption" ) is True and \
320- result .get ("acl" ) == "bucket-owner-full-control"
323+ result .get ("acl" ) == "bucket-owner-full-control" and \
324+ isinstance (result .get ("shared_config_files" ), list ) and \
325+ len (result .get ("shared_config_files" )) == 2
321326
322327
323328@pytest .mark .parametrize ("endpoints" , [
@@ -449,6 +454,7 @@ def get_version():
449454
450455
451456def deploy_tf_script (script : str , cleanup : bool = True , env_vars : Dict [str , str ] = None , user_input : str = None ):
457+ # TODO the delete keyword was added in python 3.12, and the README and setup.cfg claims compatibility with earlier python versions
452458 with tempfile .TemporaryDirectory (delete = cleanup ) as temp_dir :
453459 with open (os .path .join (temp_dir , "test.tf" ), "w" ) as f :
454460 f .write (script )
0 commit comments