22 lines
439 B
Go
22 lines
439 B
Go
package governance
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestNewClientRequiresAddress(t *testing.T) {
|
|
_, err := NewClient(Config{})
|
|
if err == nil {
|
|
t.Fatal("expected error for empty governance address")
|
|
}
|
|
}
|
|
|
|
func TestNewClientAcceptsValidConfig(t *testing.T) {
|
|
c, err := NewClient(Config{GovernanceAddr: "localhost:50051"})
|
|
if err != nil {
|
|
t.Fatalf("unexpected error: %v", err)
|
|
}
|
|
if c == nil {
|
|
t.Fatal("client should not be nil")
|
|
}
|
|
}
|