func (s *DNSXmppSuite) Test_convertAnswersToSRV_convertsAnswers(c *C) { cn := new(dns.CNAME) srv := new(dns.SRV) srv.Target = "foo2.com" in := make([]dns.RR, 2) in[0] = cn in[1] = srv res := convertAnswersToSRV(in) c.Assert(res, HasLen, 1) c.Assert(res[0].Target, Equals, "foo2.com") }
func (s *DNSXmppSuite) Test_convertAnswerToSRV_returnsAValidNetSRV(c *C) { srv := new(dns.SRV) srv.Target = "foo.com" srv.Port = 123 srv.Priority = 5 srv.Weight = 42 res := convertAnswerToSRV(srv) c.Assert(res, Not(IsNil)) c.Assert(res.Target, Equals, "foo.com") c.Assert(res.Port, Equals, uint16(123)) c.Assert(res.Priority, Equals, uint16(5)) c.Assert(res.Weight, Equals, uint16(42)) }