This commit is contained in:
@@ -85,6 +85,23 @@ async def test_validate_reports_errors():
|
||||
assert "missing" in result.message
|
||||
|
||||
|
||||
@needs_terraform
|
||||
async def test_validate_runs_in_the_directory_holding_the_files():
|
||||
broken = {"terraform/main.tf": 'output "x" {\n value = var.missing\n}\n'}
|
||||
|
||||
result = await TerraformRunner().validate(broken)
|
||||
|
||||
assert result.message.startswith("terraform validate failed")
|
||||
|
||||
|
||||
async def test_files_across_directories_are_refused():
|
||||
result = await TerraformRunner().validate(
|
||||
{"terraform/main.tf": "", "modules/net/main.tf": ""}
|
||||
)
|
||||
|
||||
assert result.message.startswith("Refused: put all files in one directory")
|
||||
|
||||
|
||||
async def test_unsafe_file_names_are_refused():
|
||||
runner = TerraformRunner()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user