@@ -8,13 +8,19 @@ import (
8
8
"testing"
9
9
)
10
10
11
+ func TestWorkspaceIDRequiredForDelete (t * testing.T ) {
12
+ if err := g .DeleteWorkspace (context .Background (), "" ); err == nil {
13
+ t .Error ("Expected error but got nil" )
14
+ }
15
+ }
16
+
11
17
func TestCreateAndDeleteWorkspace (t * testing.T ) {
12
18
id , err := g .CreateWorkspace (context .Background (), "directory" )
13
19
if err != nil {
14
20
t .Fatalf ("Error creating workspace: %v" , err )
15
21
}
16
22
17
- err = g .DeleteWorkspace (context .Background (), DeleteWorkspaceOptions { WorkspaceID : id } )
23
+ err = g .DeleteWorkspace (context .Background (), id )
18
24
if err != nil {
19
25
t .Errorf ("Error deleting workspace: %v" , err )
20
26
}
@@ -27,7 +33,7 @@ func TestWriteReadAndDeleteFileFromWorkspace(t *testing.T) {
27
33
}
28
34
29
35
t .Cleanup (func () {
30
- err := g .DeleteWorkspace (context .Background (), DeleteWorkspaceOptions { WorkspaceID : id } )
36
+ err := g .DeleteWorkspace (context .Background (), id )
31
37
if err != nil {
32
38
t .Errorf ("Error deleting workspace: %v" , err )
33
39
}
@@ -66,7 +72,7 @@ func TestLsComplexWorkspace(t *testing.T) {
66
72
}
67
73
68
74
t .Cleanup (func () {
69
- err := g .DeleteWorkspace (context .Background (), DeleteWorkspaceOptions { WorkspaceID : id } )
75
+ err := g .DeleteWorkspace (context .Background (), id )
70
76
if err != nil {
71
77
t .Errorf ("Error deleting workspace: %v" , err )
72
78
}
@@ -139,7 +145,7 @@ func TestCreateAndDeleteWorkspaceS3(t *testing.T) {
139
145
t .Fatalf ("Error creating workspace: %v" , err )
140
146
}
141
147
142
- err = g .DeleteWorkspace (context .Background (), DeleteWorkspaceOptions { WorkspaceID : id } )
148
+ err = g .DeleteWorkspace (context .Background (), id )
143
149
if err != nil {
144
150
t .Errorf ("Error deleting workspace: %v" , err )
145
151
}
@@ -156,7 +162,7 @@ func TestWriteReadAndDeleteFileFromWorkspaceS3(t *testing.T) {
156
162
}
157
163
158
164
t .Cleanup (func () {
159
- err := g .DeleteWorkspace (context .Background (), DeleteWorkspaceOptions { WorkspaceID : id } )
165
+ err := g .DeleteWorkspace (context .Background (), id )
160
166
if err != nil {
161
167
t .Errorf ("Error deleting workspace: %v" , err )
162
168
}
@@ -199,7 +205,7 @@ func TestLsComplexWorkspaceS3(t *testing.T) {
199
205
}
200
206
201
207
t .Cleanup (func () {
202
- err := g .DeleteWorkspace (context .Background (), DeleteWorkspaceOptions { WorkspaceID : id } )
208
+ err := g .DeleteWorkspace (context .Background (), id )
203
209
if err != nil {
204
210
t .Errorf ("Error deleting workspace: %v" , err )
205
211
}
0 commit comments