mirror of
https://github.com/containrrr/watchtower.git
synced 2026-02-25 08:24:07 +01:00
ensure temp file cleanup after tests
This commit is contained in:
parent
e46cca23dc
commit
abeed88313
2 changed files with 18 additions and 16 deletions
|
|
@ -1,13 +1,12 @@
|
|||
package flags
|
||||
|
||||
import (
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
"os"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestEnvConfig_Defaults(t *testing.T) {
|
||||
|
|
@ -60,9 +59,9 @@ func TestGetSecretsFromFilesWithFile(t *testing.T) {
|
|||
require.NoError(t, err)
|
||||
|
||||
// Write the secret to the temporary file.
|
||||
secret := []byte(value)
|
||||
_, err = file.Write(secret)
|
||||
_, err = file.Write([]byte(value))
|
||||
require.NoError(t, err)
|
||||
require.NoError(t, file.Close())
|
||||
|
||||
t.Setenv("WATCHTOWER_NOTIFICATION_EMAIL_SERVER_PASSWORD", file.Name())
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue