mirror of
https://github.com/hashicorp/packer.git
synced 2026-09-21 23:41:41 -04:00
Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com>
25 lines
519 B
Go
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)
|
|
}
|
|
}
|