Skip to content

Commit f2dede7

Browse files
author
vuong
committed
test for uploadDocument
1 parent 1efb353 commit f2dede7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

backend/endpoints/tests/volume_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ func TestUploadDocument(t *testing.T) {
3939
OwnerUserId: 1,
4040
}, nil).Times(1)
4141

42-
expected, _ := ioutil.TempFile(os.TempDir(), "file")
43-
defer os.Remove(expected.Name())
42+
temp, _ := ioutil.TempFile(os.TempDir(), "expected")
43+
defer os.Remove(temp.Name())
4444

4545
mockDockerFileSystemRepo := repMocks.NewMockIUnpublishedVolumeRepository(controller)
46-
mockDockerFileSystemRepo.EXPECT().GetFromVolume(entityID.String()).Return(expected, nil).Times(1)
46+
mockDockerFileSystemRepo.EXPECT().GetFromVolume(entityID.String()).Return(temp, nil).Times(1)
4747

4848
mockDepFactory := createMockDependencyFactory(controller, mockFileRepo, true)
4949
mockDepFactory.EXPECT().GetUnpublishedVolumeRepo().Return(mockDockerFileSystemRepo)
@@ -63,7 +63,7 @@ func TestUploadDocument(t *testing.T) {
6363
})
6464

6565
// check that the file was written to the docker volume
66-
actual, _ := ioutil.ReadFile(expected.Name())
66+
actual, _ := ioutil.ReadFile(temp.Name())
6767
assert.Equal(actual, []byte(fileContent))
6868

6969
}

0 commit comments

Comments
 (0)