Skip to content
This repository was archived by the owner on Sep 17, 2024. It is now read-only.

Commit 12e71d3

Browse files
committed
fix: fix downloadFile unit test
1 parent 9d1a4b8 commit 12e71d3

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

e2e/utils_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package e2e
22

33
import (
44
"os"
5+
"strings"
56
"testing"
67

78
"github.com/stretchr/testify/assert"
@@ -14,12 +15,13 @@ func TestDownloadFile(t *testing.T) {
1415
if err != nil {
1516
t.Fail()
1617
}
18+
defer os.Remove(configurationFilePath)
1719

1820
info, err := os.Stat(configurationFilePath)
1921
if os.IsNotExist(err) {
2022
t.Fail()
2123
}
2224

2325
assert.False(t, info.IsDir())
24-
assert.Equal(t, "metricbeat.yml", info.Name())
26+
assert.True(t, strings.HasPrefix(info.Name(), "metricbeat.yml"))
2527
}

0 commit comments

Comments
 (0)