You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
terraform/internal/command/testdata/test/mocking/tests/primary_mocked.tftest.hcl

40 lines
656 B

mock_provider "test" {
alias = "primary"
mock_resource "test_resource" {
defaults = {
id = "aaaa"
}
}
}
variables {
instances = 1
child_instances = 1
}
run "test" {
assert {
condition = test_resource.primary[0].id == "aaaa"
error_message = "did not apply mocks"
}
assert {
condition = module.child[0].primary[0].id == "aaaa"
error_message = "did not apply mocks"
}
assert {
condition = test_resource.secondary[0].id != "aaaa"
error_message = "wrongly applied mocks"
}
assert {
condition = module.child[0].secondary[0].id != "aaaa"
error_message = "wrongly applied mocks"
}
}