You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
433 B
25 lines
433 B
6 years ago
|
package client
|
||
|
|
||
|
import (
|
||
|
"reflect"
|
||
|
"testing"
|
||
|
|
||
|
"github.com/harmony-one/harmony/p2p"
|
||
|
)
|
||
|
|
||
|
func TestClient(t *testing.T) {
|
||
|
leaders := map[uint32]p2p.Peer{
|
||
|
0: p2p.Peer{
|
||
|
IP: "127.0.0.1",
|
||
|
Port: "90",
|
||
|
},
|
||
|
}
|
||
|
client := NewClient(nil, &leaders)
|
||
|
|
||
|
leadersGot := client.GetLeaders()
|
||
|
|
||
|
if len(leadersGot) != 1 || !reflect.DeepEqual(leaders[0], leadersGot[0]) {
|
||
|
t.Errorf("expected: %v, got: %v\n", leaders[0], leadersGot[0])
|
||
|
}
|
||
|
}
|