Ejemplo n.º 1
0
 def __init__(self, path: str, variables: List[str]):
     """
     :param path: The path to the Terraform configuration files to execute.
     :param variables: Any additional variables to set alongside the Terraform command.
     """
     self.path = get_absolute_path(path=path)
     wrapper_config_files = find_wrapper_config_files(self.path)
     wrapper_config = parse_wrapper_configs(wrapper_config_files)
     self.envvars = resolve_envvars(wrapper_config.envvars)
     self.variables = variables
Ejemplo n.º 2
0
    def test_find_wrapper_configs(self):
        """Test find wrapper configs along a confir dir's path"""
        actual_config_files = find_wrapper_config_files(
            os.path.join(os.getcwd(), 'mock_directory/config/app4')
        )
        expected_config_files = [
            os.path.join(os.getcwd(), 'mock_directory/config/.tf_wrapper'),
            os.path.join(os.getcwd(), 'mock_directory/config/app4/.tf_wrapper'),
        ]

        self.assertEqual(expected_config_files, actual_config_files)