Fix import
`local import "./mock" in non-local package`
@@ -4,10 +4,11 @@ import (
"os"
"strings"
"testing"
- "./mock"
- "github.com/stretchr/testify/assert"
+ "github.com/mackerelio/go-check-plugins/check-masterha/lib/mock"
+
"github.com/mackerelio/checkers"
+ "github.com/stretchr/testify/assert"
)
var subc = subcommand{
@@ -76,7 +77,6 @@ db003 (pid:1111) is running(0:PING_OK), master:XX.XX.XX.XX
assert.Equal(t, 3, len(extracted))
}
-
func TestExtractErrorMsg(t *testing.T) {
body := `Thu Mar 24 14:31:00 2016 - [warn] Global configuration file /etc/masterha_default.cnf not found. Skipping.
Thu Mar 24 14:31:00 2016 - [info] Reading application default configurations from /usr/local/masterha/conf/db001.cnf..
@@ -109,4 +109,3 @@ MySQL Replication Health is NOT OK!
extracted := extractErrorMsg(body)
assert.Equal(t, 4, len(strings.Split(extracted, "\n")))
}
-
