Esempio n. 1
0
func (s *TestSuite) TestNewInstanceKeyFromStringsFail(c *C) {
	_, err := inst.NewInstanceKeyFromStrings("127.0.0.1", "3306x")
	c.Assert(err, Not(IsNil))
}
Esempio n. 2
0
func (this *HttpAPI) getInstanceKey(host string, port string) (inst.InstanceKey, error) {
	instanceKey, err := inst.NewInstanceKeyFromStrings(host, port)
	return *instanceKey, err
}
Esempio n. 3
0
func (s *TestSuite) TestNewInstanceKeyFromStrings(c *C) {
	i, err := inst.NewInstanceKeyFromStrings("127.0.0.1", "3306")
	c.Assert(err, IsNil)
	c.Assert(i.Hostname, Equals, "127.0.0.1")
	c.Assert(i.Port, Equals, 3306)
}