Fix failing tests

This commit is contained in:
Mickael Remond 2019-11-04 16:32:29 +01:00
parent 3e94880916
commit ce05c3226c
No known key found for this signature in database
GPG key ID: E6F6045D79965AA3
2 changed files with 10 additions and 1 deletions

View file

@ -274,6 +274,15 @@ func (s SenderMock) Send(packet stanza.Packet) error {
return nil
}
func (s SenderMock) SendIQ(ctx context.Context, iq stanza.IQ) (chan stanza.IQ, error) {
out, err := xml.Marshal(iq)
if err != nil {
return nil, err
}
s.buffer.Write(out)
return nil, nil
}
func (s SenderMock) SendRaw(str string) error {
s.buffer.WriteString(str)
return nil

View file

@ -42,7 +42,7 @@ func TestGenerateIqId(t *testing.T) {
}
iq = stanza.NewIQ(stanza.Attrs{})
if iq.Id != "1" {
if iq.Id == "" {
t.Error("NewIQ did not generate an Id")
}