git-webhook-ci/pkg/watcher/watcher_test.go

33 lines
521 B
Go
Raw Normal View History

2023-02-26 16:07:14 +01:00
package watcher
import (
"testing"
"github.com/stretchr/testify/require"
)
var (
binaryPath = "/bin/bash"
scriptPath = "./test-script.sh"
)
func TestDeploy(t *testing.T) {
err := Deploy(binaryPath, scriptPath)
require.NoError(t, err)
}
func TestDeployError(t *testing.T) {
err := Deploy("", "")
require.Error(t, err)
}
func TestExecute(t *testing.T) {
err := execute(binaryPath, scriptPath)
require.NoError(t, err)
}
func TestExecuteError(t *testing.T) {
err := execute("", "")
require.Error(t, err)
}