2019-05-23 08:10:41 -04:00
|
|
|
package powershell
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestExecutionPolicy_Decode(t *testing.T) {
|
|
|
|
config := map[string]interface{}{
|
|
|
|
"inline": []interface{}{"foo", "bar"},
|
2019-05-23 11:05:37 -04:00
|
|
|
"execution_policy": "allsigned",
|
2019-05-23 08:10:41 -04:00
|
|
|
}
|
|
|
|
p := new(Provisioner)
|
|
|
|
err := p.Prepare(config)
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
|
2019-05-23 11:05:37 -04:00
|
|
|
if p.config.ExecutionPolicy != ExecutionPolicyAllsigned {
|
2019-05-23 08:10:41 -04:00
|
|
|
t.Fatalf("Expected AllSigned execution policy; got: %s", p.config.ExecutionPolicy)
|
|
|
|
}
|
|
|
|
}
|