@@ -53,6 +53,28 @@ func TestWriteReadAndDeleteFileFromWorkspace(t *testing.T) {
5353 t .Errorf ("Unexpected content: %s" , content )
5454 }
5555
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+
5678 // Ensure we get the error we expect when trying to read a non-existent file
5779 _ , err = g .ReadFileInWorkspace (context .Background (), "test1.txt" , ReadFileInWorkspaceOptions {WorkspaceID : id })
5880 if nf := (* NotFoundInWorkspaceError )(nil ); ! errors .As (err , & nf ) {
@@ -182,6 +204,28 @@ func TestWriteReadAndDeleteFileFromWorkspaceS3(t *testing.T) {
182204 t .Errorf ("Unexpected content: %s" , content )
183205 }
184206
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+
185229 // Ensure we get the error we expect when trying to read a non-existent file
186230 _ , err = g .ReadFileInWorkspace (context .Background (), "test1.txt" , ReadFileInWorkspaceOptions {WorkspaceID : id })
187231 if nf := (* NotFoundInWorkspaceError )(nil ); ! errors .As (err , & nf ) {
0 commit comments