Enable pyfakefs and write out Terraform config files.
(self)
| 54 | ])) |
| 55 | |
| 56 | def setUp(self): |
| 57 | """Enable pyfakefs and write out Terraform config files.""" |
| 58 | # pylint: disable=no-member |
| 59 | self.setUpPyfakefs() |
| 60 | |
| 61 | # pyhcl automatically writes "parsetab.dat" in its site-package path. |
| 62 | for path in sys.path: |
| 63 | if path.endswith('site-packages'): |
| 64 | self.fs.MakeDirectories(os.path.join(path, 'hcl')) |
| 65 | |
| 66 | # Create variables.tf file (and terraform/ directory). |
| 67 | self.fs.CreateFile( |
| 68 | VARIABLES_FILE, |
| 69 | contents='\n'.join([ |
| 70 | 'variable "aws_account_id" {}', |
| 71 | 'variable "aws_region" {}', |
| 72 | 'variable "name_prefix" {}', |
| 73 | 'variable "enable_carbon_black_downloader" {}', |
| 74 | 'variable "carbon_black_url" {}', |
| 75 | 'variable "encrypted_carbon_black_api_token" {}' |
| 76 | ]) |
| 77 | ) |
| 78 | |
| 79 | # Create terraform.tfvars file. |
| 80 | self._write_config() |
nothing calls this directly
no test coverage detected