28
port string,
29
pluginName string,
31
>
return &HandlerTestSuite{
32
>
host: host,
33
>
port: port,
34
>
pluginName: pluginName,
35
>
}
36
>
}
37
38
// SetupTest setups test
40
>
s.Assertions = require.New(s.T()) // Have to define our overridden assertions in the test setup. If we did it earlier, s.T() will return nil
41
>
}
42
43
// TestValidateConnectConfig test
45
>
cfg := new(config.SQL)
46
>
47
>
s.Error(sql.ValidateConnectConfig(cfg))
48
>
49
>
cfg.ConnectAddr = net.JoinHostPort(
50
>
environment.GetMySQLAddress(),
51
>
strconv.Itoa(environment.GetMySQLPort()),
52
>
)
53
>
s.Error(sql.ValidateConnectConfig(cfg))
54
>
55
>
cfg.DatabaseName = "foobar"
56
>
s.NoError(sql.ValidateConnectConfig(cfg))
57
>
}