@@ -53,6 +53,28 @@ func TestWriteReadAndDeleteFileFromWorkspace(t *testing.T) {
53
53
t .Errorf ("Unexpected content: %s" , content )
54
54
}
55
55
56
+ // Stat the file to ensure it exists
57
+ fileInfo , err := g .StatFileInWorkspace (context .Background (), "test.txt" , StatFileInWorkspaceOptions {WorkspaceID : id })
58
+ if err != nil {
59
+ t .Errorf ("Error statting file: %v" , err )
60
+ }
61
+
62
+ if fileInfo .WorkspaceID != id {
63
+ t .Errorf ("Unexpected file workspace ID: %v" , fileInfo .WorkspaceID )
64
+ }
65
+
66
+ if fileInfo .Name != "test.txt" {
67
+ t .Errorf ("Unexpected file name: %s" , fileInfo .Name )
68
+ }
69
+
70
+ if fileInfo .Size != 4 {
71
+ t .Errorf ("Unexpected file size: %d" , fileInfo .Size )
72
+ }
73
+
74
+ if fileInfo .ModTime .IsZero () {
75
+ t .Errorf ("Unexpected file mod time: %v" , fileInfo .ModTime )
76
+ }
77
+
56
78
// Ensure we get the error we expect when trying to read a non-existent file
57
79
_ , err = g .ReadFileInWorkspace (context .Background (), "test1.txt" , ReadFileInWorkspaceOptions {WorkspaceID : id })
58
80
if nf := (* NotFoundInWorkspaceError )(nil ); ! errors .As (err , & nf ) {
@@ -182,6 +204,28 @@ func TestWriteReadAndDeleteFileFromWorkspaceS3(t *testing.T) {
182
204
t .Errorf ("Unexpected content: %s" , content )
183
205
}
184
206
207
+ // Stat the file to ensure it exists
208
+ fileInfo , err := g .StatFileInWorkspace (context .Background (), "test.txt" , StatFileInWorkspaceOptions {WorkspaceID : id })
209
+ if err != nil {
210
+ t .Errorf ("Error statting file: %v" , err )
211
+ }
212
+
213
+ if fileInfo .WorkspaceID != id {
214
+ t .Errorf ("Unexpected file workspace ID: %v" , fileInfo .WorkspaceID )
215
+ }
216
+
217
+ if fileInfo .Name != "test.txt" {
218
+ t .Errorf ("Unexpected file name: %s" , fileInfo .Name )
219
+ }
220
+
221
+ if fileInfo .Size != 4 {
222
+ t .Errorf ("Unexpected file size: %d" , fileInfo .Size )
223
+ }
224
+
225
+ if fileInfo .ModTime .IsZero () {
226
+ t .Errorf ("Unexpected file mod time: %v" , fileInfo .ModTime )
227
+ }
228
+
185
229
// Ensure we get the error we expect when trying to read a non-existent file
186
230
_ , err = g .ReadFileInWorkspace (context .Background (), "test1.txt" , ReadFileInWorkspaceOptions {WorkspaceID : id })
187
231
if nf := (* NotFoundInWorkspaceError )(nil ); ! errors .As (err , & nf ) {
0 commit comments