40 lines
510 B
Go
40 lines
510 B
Go
package gorqlite
|
|
|
|
import "testing"
|
|
|
|
import "os"
|
|
|
|
func TestInitCluster(t *testing.T) {
|
|
|
|
TraceOn(os.Stderr)
|
|
t.Logf("trying Open")
|
|
conn, err := Open(testUrl())
|
|
if ( err != nil ) {
|
|
t.Logf("--> FAILED")
|
|
t.Fatal(err)
|
|
}
|
|
|
|
l, err := conn.Leader()
|
|
if ( err != nil ) {
|
|
t.Logf("--> FAILED")
|
|
t.Fail()
|
|
}
|
|
|
|
if ( len(l) < 1 ) {
|
|
t.Logf("--> FAILED")
|
|
t.Fail()
|
|
}
|
|
|
|
p, err := conn.Peers()
|
|
if ( err != nil ) {
|
|
t.Logf("--> FAILED")
|
|
t.Fail()
|
|
}
|
|
|
|
if ( len(p) < 1 ) {
|
|
t.Logf("--> FAILED")
|
|
t.Fail()
|
|
}
|
|
}
|
|
|