mirror of
https://github.com/containrrr/watchtower.git
synced 2025-12-13 21:56:38 +01:00
fix: testing for flag files on windows (#1249)
* fix: testing for flag files on windows * fix build script on windows/msys
This commit is contained in:
parent
2f4d58776d
commit
56368a7207
3 changed files with 22 additions and 4 deletions
|
|
@ -11,6 +11,10 @@ import (
|
|||
)
|
||||
|
||||
func TestEnvConfig_Defaults(t *testing.T) {
|
||||
// Unset testing environments own variables, since those are not what is under test
|
||||
os.Unsetenv("DOCKER_TLS_VERIFY")
|
||||
os.Unsetenv("DOCKER_HOST")
|
||||
|
||||
cmd := new(cobra.Command)
|
||||
SetDefaults()
|
||||
RegisterDockerFlags(cmd)
|
||||
|
|
@ -94,3 +98,8 @@ func TestHTTPAPIPeriodicPollsFlag(t *testing.T) {
|
|||
|
||||
assert.Equal(t, true, periodicPolls)
|
||||
}
|
||||
|
||||
func TestIsFile(t *testing.T) {
|
||||
assert.False(t, isFile("https://google.com"), "an URL should never be considered a file")
|
||||
assert.True(t, isFile(os.Args[0]), "the currently running binary path should always be considered a file")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue