Files
Packer-Cn/provisioner/powershell/execution_policy_test.go
T
hashicorp-copywrite[bot] b7df3ca36f [COMPLIANCE] Add Copyright and License Headers (#12254)
Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com>
2023-03-02 15:37:05 -05:00

25 lines
519 B
Go

// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
package powershell
import (
"testing"
)
func TestExecutionPolicy_Decode(t *testing.T) {
config := map[string]interface{}{
"inline": []interface{}{"foo", "bar"},
"execution_policy": "allsigned",
}
p := new(Provisioner)
err := p.Prepare(config)
if err != nil {
t.Fatal(err)
}
if p.config.ExecutionPolicy != ExecutionPolicyAllsigned {
t.Fatalf("Expected AllSigned execution policy; got: %s", p.config.ExecutionPolicy)
}
}