Silence StatusNotImplemented error for Logout()

This commit is contained in:
Julien Laffaye 2015-08-19 00:17:44 +02:00
parent c741076986
commit 519b366223

View File

@ -3,6 +3,7 @@ package ftp
import (
"bytes"
"io/ioutil"
"net/textproto"
"testing"
"time"
)
@ -110,7 +111,13 @@ func TestConn(t *testing.T) {
err = c.Logout()
if err != nil {
t.Error(err)
if protoErr := err.(*textproto.Error); protoErr != nil {
if protoErr.Code != StatusNotImplemented {
t.Error(err)
}
} else {
t.Error(err)
}
}
c.Quit()