Skip to content

Commit

Permalink
more test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcia Piccione authored and Marcia Piccione committed Feb 21, 2023
1 parent c135e2c commit b287856
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion kratos_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ var (
fmt.Println("hi")
return nil
},
ClientLogger: nil,
ClientLogger: sallust.Default(),
PingConfig: PingConfig{},
}

Expand Down Expand Up @@ -209,8 +209,27 @@ func TestNew(t *testing.T) {
assert.Equal("127.0.0.1", testClient.Hostname())
assert.Nil(err)

testClient.HandlerRegistry().GetHandler("reader")
}

func TestNew_NoPingMissHandler(t *testing.T) {
clientConfigNoPingMiss := clientConfig
clientConfigNoPingMiss.HandlePingMiss = nil
assert := assert.New(t)
_, err := NewClient(clientConfigNoPingMiss)
assert.Equal(err, errNilHandlePingMiss)
}

// func TestNew_ClientLoggerNotNil(t *testing.T) {
// logger := sallust.Default()
// clientConfigHasLogger := clientConfig
// clientConfigHasLogger.ClientLogger = logger
// assert := assert.New(t)
// _, err := NewClient(clientConfigHasLogger)

// assert.Nil(err)
// }

func Error(s string) {
panic("unimplemented")
}
Expand Down

0 comments on commit b287856

Please sign in to comment.