@@ -2,14 +2,16 @@ package octopusdeploy_framework
22
33import (
44 "fmt"
5+ "path/filepath"
6+ "testing"
7+
8+ "github.com/OctopusDeploy/go-octopusdeploy/v2/pkg/scriptmodules"
59 "github.com/OctopusDeploy/go-octopusdeploy/v2/pkg/variables"
610 "github.com/OctopusSolutionsEngineering/OctopusTerraformTestFramework/octoclient"
711 "github.com/OctopusSolutionsEngineering/OctopusTerraformTestFramework/test"
812 "github.com/hashicorp/terraform-plugin-testing/helper/acctest"
913 "github.com/hashicorp/terraform-plugin-testing/helper/resource"
1014 "github.com/hashicorp/terraform-plugin-testing/terraform"
11- "path/filepath"
12- "testing"
1315)
1416
1517func TestAccOctopusDeployScriptModuleBasic (t * testing.T ) {
@@ -102,7 +104,7 @@ func TestScriptModuleResource(t *testing.T) {
102104 Take : 1 ,
103105 }
104106
105- resources , err := client . LibraryVariableSets . Get (query )
107+ resources , err := scriptmodules . Get (client , newSpaceId , query )
106108 if err != nil {
107109 t .Fatal (err .Error ())
108110 }
@@ -116,6 +118,14 @@ func TestScriptModuleResource(t *testing.T) {
116118 t .Fatal ("The library variable set must be have a description of \" Test script module\" (was \" " + resource .Description + "\" )" )
117119 }
118120
121+ if resource .Syntax != "PowerShell" {
122+ t .Fatal ("The script module must have a syntax of \" PowerShell\" (was \" " + resource .Syntax + "\" )" )
123+ }
124+
125+ if resource .ScriptBody != "echo \" hi\" " {
126+ t .Fatal ("The script module must have a script body of \" echo \" hi\" \" (was \" " + resource .ScriptBody + "\" )" )
127+ }
128+
119129 variables , err := client .Variables .GetAll (resource .ID )
120130
121131 if len (variables .Variables ) != 2 {
0 commit comments