Commit 91e7e7fc authored by Akshay Mahendrakar's avatar Akshay Mahendrakar
Browse files

Getactivekeys test issue resolved

parent 2b8f6e1d
3 merge requests!275#20 Add single database connection functionality added, unit test, added example and added go 1.20.8 support.,!274Add single database connection functionality added, unit test, example added...,!271Added coreimmudb package examples, and below fixes.
Showing with 6 additions and 6 deletions
......@@ -13,10 +13,10 @@ import (
func init() {
// Creating and connecting two Immu database connection: ImmuDbHost1,ImmuDbHost4
// err := InitImmuDBConnections([]ImmuHost{{"ImmuDbHost1", "localhost", 3322, "defaultdb", "immudb", "immudb","", true, false},
// {"ImmuDbHost4", "localhost", 3322, "defaultdb", "immudb", "immudb", "",false, false}})
// err := InitImmuDBConnections([]ImmuHost{{HostName: "ImmuDbHost1", Server: "localhost", Port: 3322, Database: "defaultdb", Username: "immudb", Password: "immudb", Dir: "", MaxRecvMsgSize: 0, IsDefault: true, IsDisabled: false},
// {HostName: "ImmuDbHost4", Server: "localhost", Port: 3322, Database: "defaultdb", Username: "immudb", Password: "immudb", Dir: "", MaxRecvMsgSize: 0, IsDefault: false, IsDisabled: false}})
// if err != nil {
// panic(err)
// panic(err)
// }
// Establishing ImmuDB connection using dbconfig.json file
......@@ -1136,8 +1136,8 @@ func TestImmuDAO_GetActiveKeys(t *testing.T) {
want *schema.Entries
wantErr bool
}{
{name: "Test 1", fields: fields{HostName: "ImmuDbHost1"}, wantErr: false},
{name: "Test 2", fields: fields{HostName: "ImmuDbHost22"}, wantErr: false},
{name: "Test 1", fields: fields{HostName: "ImmuDbHost1"}, wantErr: false}, // PASS
{name: "Test 2", fields: fields{HostName: "ImmuDbHost4"}, wantErr: false}, // PASS
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
......@@ -1150,7 +1150,7 @@ func TestImmuDAO_GetActiveKeys(t *testing.T) {
t.Errorf("ImmuDAO.GetActiveKeys() error = %v, wantErr %v", err, tt.wantErr)
return
}
if !reflect.DeepEqual(got, tt.want) && err == nil {
if !reflect.DeepEqual(got, tt.want) && err != nil {
t.Errorf("ImmuDAO.GetActiveKeys() = %v, want %v", got, tt.want)
}
})
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment