Forked the emersion/go-imap v1 project.
This commit is contained in:
24
imapclient/authenticate_test.go
Normal file
24
imapclient/authenticate_test.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package imapclient_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/emersion/go-sasl"
|
||||
|
||||
"github.com/emersion/go-imap/v2"
|
||||
)
|
||||
|
||||
func TestClient_Authenticate(t *testing.T) {
|
||||
client, server := newClientServerPair(t, imap.ConnStateNotAuthenticated)
|
||||
defer client.Close()
|
||||
defer server.Close()
|
||||
|
||||
saslClient := sasl.NewPlainClient("", testUsername, testPassword)
|
||||
if err := client.Authenticate(saslClient); err != nil {
|
||||
t.Fatalf("Authenticate() = %v", err)
|
||||
}
|
||||
|
||||
if state := client.State(); state != imap.ConnStateAuthenticated {
|
||||
t.Errorf("State() = %v, want %v", state, imap.ConnStateAuthenticated)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user