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