updater: imp test
This commit is contained in:
parent
c9efb412e7
commit
872cd3a18c
|
@ -46,7 +46,7 @@ func TestUpdater_internal(t *testing.T) {
|
||||||
for _, tc := range testCases {
|
for _, tc := range testCases {
|
||||||
exePath := filepath.Join(wd, tc.exeName)
|
exePath := filepath.Join(wd, tc.exeName)
|
||||||
|
|
||||||
// start server for returning package file
|
// Start server for returning package file.
|
||||||
pkgData, err := os.ReadFile(filepath.Join("testdata", tc.archiveName))
|
pkgData, err := os.ReadFile(filepath.Join("testdata", tc.archiveName))
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
|
@ -76,7 +76,6 @@ func TestUpdater_internal(t *testing.T) {
|
||||||
|
|
||||||
u.clean()
|
u.clean()
|
||||||
|
|
||||||
// Consider the following subtest necessary.
|
|
||||||
require.True(t, t.Run("backup", func(t *testing.T) {
|
require.True(t, t.Run("backup", func(t *testing.T) {
|
||||||
var d []byte
|
var d []byte
|
||||||
d, err = os.ReadFile(filepath.Join(wd, "agh-backup", "AdGuardHome.yaml"))
|
d, err = os.ReadFile(filepath.Join(wd, "agh-backup", "AdGuardHome.yaml"))
|
||||||
|
@ -90,7 +89,7 @@ func TestUpdater_internal(t *testing.T) {
|
||||||
assert.Equal(t, tc.exeName, string(d))
|
assert.Equal(t, tc.exeName, string(d))
|
||||||
}))
|
}))
|
||||||
|
|
||||||
t.Run("updated", func(t *testing.T) {
|
require.True(t, t.Run("updated", func(t *testing.T) {
|
||||||
var d []byte
|
var d []byte
|
||||||
d, err = os.ReadFile(exePath)
|
d, err = os.ReadFile(exePath)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
@ -111,6 +110,6 @@ func TestUpdater_internal(t *testing.T) {
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
assert.Equal(t, "AdGuardHome.yaml", string(d))
|
assert.Equal(t, "AdGuardHome.yaml", string(d))
|
||||||
})
|
}))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue